diff --git a/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/Application/MyAbilityStage.ts index a306554358018192c9831d17db0ed5cc7f8e8fe2..e99f704f1394abb68532c61c23ddd25b1b6cb9ad 100644 --- a/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/Application/MyAbilityStage.ts +++ b/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/Application/MyAbilityStage.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityStage from "@ohos.application.AbilityStage" +import AbilityStage from "@ohos.app.ability.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { diff --git a/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts index 013b4b2213b723e4100423915dd7ba6c9b94a93c..36dc4a9e1b73dbdb097b9a0e4f66a0be1936a30a 100644 --- a/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' diff --git a/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/Application/MyAbilityStage.ts index 2f96918c937982a919a3d818c59b58c0b48839c9..bd9344d3424b7fcac7e8b19e83c0332a52332b8a 100644 --- a/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/Application/MyAbilityStage.ts +++ b/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/Application/MyAbilityStage.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityStage from "@ohos.application.AbilityStage" +import AbilityStage from "@ohos.app.ability.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { diff --git a/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts index 0406bb1f43c8cc712dde999d05f7dbf9893ca94a..6c30c664458a07c04deea9a61033e63d0acdbdc4 100644 --- a/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' export default class MainAbility extends Ability { onCreate(want, launchParam) { diff --git a/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/TestAbility/TestAbility.ts b/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/TestAbility/TestAbility.ts index 893b774bafd5fbe32f933bab2179df686d735b7e..4847e5bbb4c8ab74fe03990a08a2f864b5d361e4 100644 --- a/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/TestAbility/TestAbility.ts +++ b/ability/ability_runtime/context/actsstagecontexttest/entry/src/main/ets/TestAbility/TestAbility.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' diff --git a/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/Application/MyAbilityStage.ts index 7801446f06c2459a6e4afbff148d5ff0154157e6..1745223233b86a18959e766ffa372aa97df4e936 100644 --- a/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/Application/MyAbilityStage.ts +++ b/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/Application/MyAbilityStage.ts @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import AbilityStage from "@ohos.application.AbilityStage" +import AbilityStage from "@ohos.app.ability.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { diff --git a/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/MainAbility/MainAbility.ts index b2b12fe7cd0d4c16c4da86f31429b28f8f206a95..232eee4562e1fe26b76487c22bed3057999bba78 100644 --- a/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/context/actsstagecontexttest/module1/src/main/ets/MainAbility/MainAbility.ts @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/Application/MyAbilityStage.ts index 2f96918c937982a919a3d818c59b58c0b48839c9..bd9344d3424b7fcac7e8b19e83c0332a52332b8a 100644 --- a/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/Application/MyAbilityStage.ts +++ b/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/Application/MyAbilityStage.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityStage from "@ohos.application.AbilityStage" +import AbilityStage from "@ohos.app.ability.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { diff --git a/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/MainAbility/MainAbility.ts index 602d992cefd7fc524cd6477b0daa559d0184c881..b362084c9a4c92b3b3ccb1160a60bd890e672b22 100644 --- a/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/context/scene/contextapp/entry/src/main/ets/MainAbility/MainAbility.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' export default class MainAbility extends Ability { onCreate(want, launchParam) { diff --git a/ability/ability_runtime/freeinstalltest/BUILD.gn b/ability/ability_runtime/freeinstalltest/BUILD.gn index 7afe0fa513611aea0314558808777abdc19418b7..a20eaa82e6e3284df2494730c7cf8f3b794fd65f 100644 --- a/ability/ability_runtime/freeinstalltest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/BUILD.gn @@ -29,30 +29,13 @@ group("freeinstalltest") { "connectabilityfatest/connectfamyapplication7:ConnectFaMyApplication7", "connectabilityfatest/connectfamyapplication8:ConnectFaMyApplication8", "connectabilityfatest/connectfamyapplication9:ConnectFaMyApplication9", - "connectabilitystagetest/actsfreeinstallconnectabilitystagetest:ActsFreeInstallConnectAbilityStageTest", - "connectabilitystagetest/connectstagemyapplication0:ConnectStageMyApplication0", - "connectabilitystagetest/connectstagemyapplication1:ConnectStageMyApplication1", - "connectabilitystagetest/connectstagemyapplication2:ConnectStageMyApplication2", - "connectabilitystagetest/connectstagemyapplication3:ConnectStageMyApplication3", - "connectabilitystagetest/connectstagemyapplication4:ConnectStageMyApplication4", - "connectabilitystagetest/connectstagemyapplication5:ConnectStageMyApplication5", - "connectabilitystagetest/connectstagemyapplication6:ConnectStageMyApplication6", - "connectabilitystagetest/connectstagemyapplication7:ConnectStageMyApplication7", - "connectabilitystagetest/connectstagemyapplication8:ConnectStageMyApplication8", "mockservice:MockService", "mockservicetimeout:MockServiceTimeout", - "startabilityfatest/actsfreeinstallstartabilityfatest:ActsFreeInstallStartAbilityFaTest", "startabilityfatest/actsstartabilitynotargetbundlelistfatest:ActsStartAbilityNoTargetBundleListFaTest", "startabilityfatest/atomizationfaentry:AtomizationFaEntry", - "startabilityfatest/atomizationfahm2:AtomizationFaHm2", - "startabilityfatest/atomizationfahm4:AtomizationFaHm4", "startabilityfatest/famyapplication1:FaMyApplication1", - "startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest:ActsFreeInstallStartAbilityForResultFaTest", "startabilityforresultfatest/actsstartabilityforresultnotargetfatest:ActsStartAbilityForResultNoTargetFaTest", - "startabilityforresultfatest/atomizationresulta:AtomizationResultA", "startabilityforresultfatest/atomizationresultfaentry:AtomizationResultFaEntry", - "startabilityforresultfatest/atomizationresultfahm1:AtomizationResultFaHm1", - "startabilityforresultfatest/atomizationresultfahm2:AtomizationResultFaHm2", "startabilityforresultfatest/faresultmyapplication1:FaResultMyApplication1", "startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest:ActsFreeInstallStartAbilityForResultStageTest", "startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest:ActsStartAbilityForResultNoTargetBundleListStageTest", diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets index dfa9c3eb01506ac299f379e38dc1b31ee881647f..71c6c129811f8ca20095f46164677fa274d74231 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets index 19e80d90ebcc37e4c3614ae866af998eafc65f82..3d26b03273556a59ca9c9caa3ae2a53775cd2a30 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,9 +25,9 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry export default function ConnectAbilityTest() { - let TAG = ""; - let Tempassert = ""; - let abilityDelegator = undefined + var TAG = ""; + var Tempassert = ""; + var abilityDelegator = undefined function sleep(time) { return new Promise((resolve) => setTimeout(resolve, time)) @@ -35,19 +37,19 @@ export default function ConnectAbilityTest() { beforeAll(async function (done) { console.info("FreeInstall_FA_ConnectAbility before all called"); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - let cmd = "bm install -p data/test/MockService.hap"; + var cmd = "bm install -p data/test/MockService.hap"; console.info("cmd : " + cmd) console.info(TAG + " abilityDelegator : " + JSON.stringify(abilityDelegator)); abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) await sleep(500); - let cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; + var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => { console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) await sleep(500); - let cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; + var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => { console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); done(); @@ -57,12 +59,11 @@ export default function ConnectAbilityTest() { afterEach(async (done) => { console.info("FreeInstall_FA_ConnectAbility after each called"); Tempassert = "" - if ("FreeInstall_FA_ConnectAbility_1300" === TAG) { - let cmd14 = "bm uninstall -n com.ohos.hag.famanager"; + if ("FreeInstall_FA_ConnectAbility_2000" === TAG) { + var cmd14 = "bm uninstall -n com.ohos.hag.famanager"; abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => { console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(2000) } done(); }); @@ -126,32 +127,33 @@ export default function ConnectAbilityTest() { it("FreeInstall_FA_ConnectAbility_0100", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_0100-------------"); TAG = "FreeInstall_FA_ConnectAbility_0100"; - let cmd4 = "cp data/test/ConnectFaMyApplication6.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" + + var cmd4 = "cp data/test/ConnectFaMyApplication6.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" + "/entry/files"; abilityDelegator.executeShellCommand(cmd4, (err: any, d: any) => { console.info(TAG + " executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - let deviceid = "0"; - abilityManager.getTopAbility((err, data) => { - console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); - console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId)); - deviceid = data.deviceId; - }) - await sleep(500) - let request1 = { - "deviceId": deviceid, - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication6.ServiceAbility", - "moduleName": "myapplication6", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request1); - setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - done(); - }, 2000) + setTimeout(async () => { + var deviceid = "0"; + await abilityManager.getTopAbility((err, data) => { + console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); + console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId)); + deviceid = data.deviceId; + }) + var request1 = { + "deviceId": deviceid, + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication6.ServiceAbility", + "moduleName": "myapplication6", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request1); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500) + }, 2000); console.log("------------end FreeInstall_FA_ConnectAbility_0100-------------"); + done(); }); /* @@ -163,32 +165,31 @@ export default function ConnectAbilityTest() { it("FreeInstall_FA_ConnectAbility_0200", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_0200-------------"); TAG = "FreeInstall_FA_ConnectAbility_0200"; - let cmdapp10 = "bm install -p data/test/ConnectFaMyApplication10.hap"; + var cmdapp10 = "bm install -p data/test/ConnectFaMyApplication10.hap"; abilityDelegator.executeShellCommand(cmdapp10, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - let deviceid = "0"; - await abilityManager.getTopAbility((err, data) => { - console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); - console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId)); - deviceid = data.deviceId; - }) - await sleep(500) - let request2 = { - "deviceId": deviceid, - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication10.ServiceAbility", - "moduleName": "myapplication10", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request2); - - setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_0200-------------"); - done(); - }, 2000) - + setTimeout(async () => { + var deviceid = "0"; + await abilityManager.getTopAbility((err, data) => { + console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); + console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId)); + deviceid = data.deviceId; + }) + var request2 = { + "deviceId": deviceid, + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication10.ServiceAbility", + "moduleName": "myapplication10", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request2); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500) + }, 2500); + console.log("------------end FreeInstall_FA_ConnectAbility_0200-------------"); + done(); }); /* @@ -200,24 +201,26 @@ export default function ConnectAbilityTest() { it("FreeInstall_FA_ConnectAbility_0300", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_0300-------------"); TAG = "FreeInstall_FA_ConnectAbility_0300"; - let cmd3 = "cp data/test/ConnectFaMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; + var cmd3 = "cp data/test/ConnectFaMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; abilityDelegator.executeShellCommand(cmd3, (err: any, d: any) => { console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - let request3 = { - "deviceId": "", - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication1.ServiceAbility_feature", - "moduleName": "myapplication1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request3); - setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_0300-------------"); - done(); - }, 2000) + setTimeout(async () => { + var request3 = { + "deviceId": "", + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication1.ServiceAbility_feature", + "moduleName": "myapplication1", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request3); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500) + }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_0300-------------"); + done(); }); /* @@ -229,24 +232,25 @@ export default function ConnectAbilityTest() { it("FreeInstall_FA_ConnectAbility_0400", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_0400-------------"); TAG = "FreeInstall_FA_ConnectAbility_0400"; - let cmdapp11 = "bm install -p data/test/ConnectFaMyApplication11.hap"; + var cmdapp11 = "bm install -p data/test/ConnectFaMyApplication11.hap"; abilityDelegator.executeShellCommand(cmdapp11, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(2000) - let request4 = { - "deviceId": "", - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication11.ServiceAbility", - "moduleName": "myapplication11", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request4); - setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_0400-------------"); - done(); - }, 2000) + setTimeout(async () => { + var request4 = { + "deviceId": "", + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication11.ServiceAbility", + "moduleName": "myapplication11", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request4); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500) + }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_0400-------------"); + done(); }); /* @@ -259,18 +263,20 @@ export default function ConnectAbilityTest() { console.log("------------start FreeInstall_FA_ConnectAbility_0500-------------"); TAG = "FreeInstall_FA_ConnectAbility_0500"; - let request5 = { - "bundleName": "com.example.different.hmservice", - "abilityName": "com.example.different.ServiceAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request5); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_0500-------------"); - done(); + setTimeout(async () => { + var request5 = { + "bundleName": "com.example.different.hmservice", + "abilityName": "com.example.different.ServiceAbility", + "moduleName": "entry", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request5); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_0500-------------"); + done(); }); /* @@ -283,18 +289,20 @@ export default function ConnectAbilityTest() { console.log("------------start FreeInstall_FA_ConnectAbility_0600-------------"); TAG = "FreeInstall_FA_ConnectAbility_0600"; - let request6 = { - "bundleName": "", - "abilityName": "com.example.myapplication1.ServiceAbility_feature", - "moduleName": "myapplication1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request6); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_0600-------------"); - done(); + setTimeout(async () => { + var request6 = { + "bundleName": "", + "abilityName": "com.example.myapplication1.ServiceAbility_feature", + "moduleName": "myapplication1", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request6); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_0600-------------"); + done(); }); /* @@ -307,18 +315,20 @@ export default function ConnectAbilityTest() { console.log("------------start FreeInstall_FA_ConnectAbility_0700-------------"); TAG = "FreeInstall_FA_ConnectAbility_0700"; - let request7 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "", - "moduleName": "myapplication1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request7); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_0700-------------"); - done(); + setTimeout(async () => { + var request7 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "", + "moduleName": "myapplication1", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request7); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_0700-------------"); + done(); }); /* @@ -331,19 +341,21 @@ export default function ConnectAbilityTest() { console.log("------------start FreeInstall_FA_ConnectAbility_0800-------------"); TAG = "FreeInstall_FA_ConnectAbility_0800"; - let request8 = { - "deviceId": "xxxxxx", - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication2.ServiceAbility", - "moduleName": "myapplication2", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request8); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_0800-------------"); - done(); + setTimeout(async () => { + var request8 = { + "deviceId": "xxxxxx", + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication2.ServiceAbility", + "moduleName": "myapplication2", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request8); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_0800-------------"); + done(); }); /* @@ -356,18 +368,20 @@ export default function ConnectAbilityTest() { console.log("------------start FreeInstall_FA_ConnectAbility_0900-------------"); TAG = "FreeInstall_FA_ConnectAbility_0900"; - let request9 = { - "bundleName": "com.example.xxx.hmservice", - "abilityName": "com.example.myapplication2.ServiceAbility", - "moduleName": "myapplication2", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request9); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_0900-------------"); - done(); + setTimeout(async () => { + var request9 = { + "bundleName": "com.example.xxx.hmservice", + "abilityName": "com.example.myapplication2.ServiceAbility", + "moduleName": "myapplication2", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request9); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_0900-------------"); + done(); }); /* @@ -380,18 +394,20 @@ export default function ConnectAbilityTest() { console.log("------------start FreeInstall_FA_ConnectAbility_1000-------------"); TAG = "FreeInstall_FA_ConnectAbility_1000"; - let request10 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication2.ServiceAbility", - "moduleName": "myapplication2", - "flags": 1111111, - } - connectabillity(TAG, request10); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------"); - done(); + setTimeout(async () => { + var request10 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication2.ServiceAbility", + "moduleName": "myapplication2", + "flags": 1111111, + } + connectabillity(TAG, request10); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------"); + done(); }); /* @@ -403,23 +419,25 @@ export default function ConnectAbilityTest() { it("FreeInstall_FA_ConnectAbility_1100", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1100-------------"); TAG = "FreeInstall_FA_ConnectAbility_1100"; - let cmdapp2 = "bm install -p data/test/ConnectFaMyApplication2.hap"; + var cmdapp2 = "bm install -p data/test/ConnectFaMyApplication2.hap"; abilityDelegator.executeShellCommand(cmdapp2, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(2000) - let request11 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication2.ServiceAbility", - "moduleName": "myapplication2", - "flags": "11", - } - connectabillity(TAG, request11); - setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------"); - done(); + + setTimeout(async () => { + var request11 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication2.ServiceAbility", + "moduleName": "myapplication2", + "flags": "11", + } + connectabillity(TAG, request11); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------"); + done(); }); /* @@ -431,22 +449,24 @@ export default function ConnectAbilityTest() { it("FreeInstall_FA_ConnectAbility_1200", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1200-------------"); TAG = "FreeInstall_FA_ConnectAbility_1200"; - let cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*"; + var cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*"; abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - let request12 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication1.ServiceAbility_feature", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request12); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_1200-------------"); - done(); + setTimeout(async () => { + var request12 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication1.ServiceAbility_feature", + "moduleName": "myapplication3", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request12); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1200-------------"); + done(); }); /* @@ -458,7 +478,7 @@ export default function ConnectAbilityTest() { it("FreeInstall_FA_ConnectAbility_1300", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1300-------------"); TAG = "FreeInstall_FA_ConnectAbility_1300"; - let str = { + var str = { "want": { "bundleName": "com.example.myapplication.hmservice", "abilityName": "com.example.myapplication.MainAbility2", @@ -472,18 +492,21 @@ export default function ConnectAbilityTest() { console.error(TAG + " startmainability2 failed. Cause: " + JSON.stringify(error)); }) - let request13 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication1.ServiceAbility_feature", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request13); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_1300-------------"); - done(); + setTimeout(async () => { + var request13 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication1.ServiceAbility_feature", + "moduleName": "myapplication3", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request13); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1300-------------"); + done(); }); + }) } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets index 4a10735f4a9691333ac1d8c34a0849e1651cf00b..38282979cc69d511a3088c9a27d335706456b0a2 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, afterEach, it, expect } from "@ohos/hypium" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import rpc from '@ohos.rpc'; import featureAbility from '@ohos.ability.featureAbility'; import wantConstant from '@ohos.ability.wantConstant' @@ -22,9 +24,9 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry export default function ConnectAbilityTest1() { - let TAG = ""; - let Tempassert = ""; - let abilityDelegator = undefined + var TAG = ""; + var Tempassert = ""; + var abilityDelegator = undefined function sleep(time) { return new Promise((resolve) => setTimeout(resolve, time)) @@ -34,19 +36,17 @@ export default function ConnectAbilityTest1() { beforeAll(async function (done) { console.info("FreeInstall_FA_ConnectAbility before all called"); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - let cmd = "bm install -p data/test/MockService.hap"; + var cmd = "bm install -p data/test/MockService.hap"; console.info("cmd : " + cmd) console.info(TAG + " abilityDelegator : " + JSON.stringify(abilityDelegator)); abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(500); - let cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; + var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => { console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(500); - let cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; + var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => { console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); done(); @@ -56,12 +56,11 @@ export default function ConnectAbilityTest1() { afterEach(async function (done) { console.info("FreeInstall_FA_ConnectAbility after each called"); Tempassert = "" - if ("FreeInstall_FA_ConnectAbility_2000" === TAG) { - let cmd14 = "bm uninstall -n com.ohos.hag.famanager"; + if ("FreeInstall_FA_ConnectAbility_1600" === TAG) { + var cmd14 = "bm uninstall -n com.ohos.hag.famanager"; abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => { console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(2000) } done(); }); @@ -116,6 +115,8 @@ export default function ConnectAbilityTest1() { console.info(msg + "END"); } + + /* * @tc.number FreeInstall_FA_ConnectAbility_1500 * @tc.name The application is not in the foreground, @@ -126,12 +127,11 @@ export default function ConnectAbilityTest1() { it("FreeInstall_FA_ConnectAbility_1500", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1500-------------"); TAG = "FreeInstall_FA_ConnectAbility_1500"; - let cmddif = "bm install -p data/test/ConnectDifferentApplication.hap"; + var cmddif = "bm install -p data/test/ConnectDifferentApplication.hap"; abilityDelegator.executeShellCommand(cmddif, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(2000) - let str = { + var str = { "want": { "bundleName": "com.example.different.hmservice", "abilityName": "MainAbility", @@ -143,18 +143,20 @@ export default function ConnectAbilityTest1() { }).catch((error) => { console.error(TAG + " startother failed. Cause: " + JSON.stringify(error)); }) - let request15 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication5.ServiceAbility5", - "moduleName": "myapplication5", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request15); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_1500-------------"); - done(); + setTimeout(async () => { + var request15 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication5.ServiceAbility5", + "moduleName": "myapplication5", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request15); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1500-------------"); + done(); }); /* @@ -167,12 +169,11 @@ export default function ConnectAbilityTest1() { it("FreeInstall_FA_ConnectAbility_1600", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1600-------------"); TAG = "FreeInstall_FA_ConnectAbility_1600"; - let cmdmyapp4 = "bm install -p data/test/ConnectFaMyApplication4.hap"; + var cmdmyapp4 = "bm install -p data/test/ConnectFaMyApplication4.hap"; abilityDelegator.executeShellCommand(cmdmyapp4, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(2000) - let str = { + var str = { "want": { "bundleName": "com.example.different.hmservice", "abilityName": "MainAbility", @@ -185,18 +186,20 @@ export default function ConnectAbilityTest1() { console.error(TAG + " startother failed. Cause: " + JSON.stringify(error)); }) - let request16 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication4.ServiceAbility4", - "moduleName": "myapplication4", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request16); - setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_1600-------------"); - done(); + setTimeout(function () { + var request16 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication4.ServiceAbility4", + "moduleName": "myapplication4", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request16); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1600-------------"); + done(); }); /* @@ -208,7 +211,7 @@ export default function ConnectAbilityTest1() { it("FreeInstall_FA_ConnectAbility_1400", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1400-------------"); TAG = "FreeInstall_FA_ConnectAbility_1400"; - let str = { + var str = { "want": { "bundleName": "com.example.myapplication.hmservice", "abilityName": "com.example.myapplication2.MainAbility", @@ -221,18 +224,20 @@ export default function ConnectAbilityTest1() { }).catch((error) => { console.error(TAG + " startmyapp2 failed. Cause: " + JSON.stringify(error)); }) - let request14 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication1.ServiceAbility_feature", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request14); setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_1400-------------"); - done() + var request14 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication1.ServiceAbility_feature", + "moduleName": "myapplication3", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request14); + setTimeout(async () => { + expect(Tempassert).assertEqual("onFailed"); + }, 500); }, 2000) + done(); + console.log("------------end FreeInstall_FA_ConnectAbility_1400-------------"); }); /* @@ -244,22 +249,23 @@ export default function ConnectAbilityTest1() { it("FreeInstall_FA_ConnectAbility_1700", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1700-------------"); TAG = "FreeInstall_FA_ConnectAbility_1700"; - let cmddif = "bm install -p data/test/ConnectDifferentApplication.hap"; + var cmddif = "bm install -p data/test/ConnectDifferentApplication.hap"; await abilityDelegator.executeShellCommand(cmddif, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(2000) - let request17 = { - "bundleName": "com.example.different.hmservice", - "abilityName": "com.example.different.ServiceAbility", - "moduleName": "entry", - } - connectabillity(TAG, request17); setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_1700-------------"); - done(); + var request17 = { + "bundleName": "com.example.different.hmservice", + "abilityName": "com.example.different.ServiceAbility", + "moduleName": "entry", + } + connectabillity(TAG, request17); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500); }, 2000) + console.log("------------end FreeInstall_FA_ConnectAbility_1700-------------"); + done(); }); /* @@ -271,18 +277,21 @@ export default function ConnectAbilityTest1() { it("FreeInstall_FA_ConnectAbility_1800", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1800-------------"); TAG = "FreeInstall_FA_ConnectAbility_1800"; - let request18 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication1.ServiceAbility_feature", - "moduleName": "xxxxx", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request18); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_1800-------------"); - done(); + + setTimeout(async () => { + var request18 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication1.ServiceAbility_feature", + "moduleName": "xxxxx", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request18); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1800-------------"); + done(); }); /* @@ -294,23 +303,25 @@ export default function ConnectAbilityTest1() { it("FreeInstall_FA_ConnectAbility_1900", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_1900-------------"); TAG = "FreeInstall_FA_ConnectAbility_1900"; - let cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + + var cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + "haps/entry/files"; await abilityDelegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - let request19 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication1.ServiceAbility_feature", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request19); - setTimeout(() => { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_1900-------------"); - done(); + setTimeout(async () => { + var request19 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication1.ServiceAbility_feature", + "moduleName": "myapplication3", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + } + connectabillity(TAG, request19); + setTimeout(() => { + expect(Tempassert).assertEqual("onFailed"); + }, 500) }, 2000); + console.log("------------end FreeInstall_FA_ConnectAbility_1900-------------"); + done(); }); /* @@ -322,27 +333,28 @@ export default function ConnectAbilityTest1() { it("FreeInstall_FA_ConnectAbility_2000", 0, async function (done) { console.log("------------start FreeInstall_FA_ConnectAbility_2000-------------"); TAG = "FreeInstall_FA_ConnectAbility_2000"; - let cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + + var cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + "haps/entry/files"; abilityDelegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => { console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) - await sleep(1000) - let request20 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication5.ServiceAbility5", - "moduleName": "myapplication5", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - "parameters": { - "name": 1111, "key1": "value1", "site": "nice to meet you!" - }, - } - connectabillity(TAG, request20); - setTimeout(() => { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_2000-------------"); - done() + setTimeout(async () => { + var request20 = { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication5.ServiceAbility5", + "moduleName": "myapplication5", + "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, + "parameters": { + "name": 1111, "key1": "value1", "site": "nice to meet you!" + }, + } + connectabillity(TAG, request20); + setTimeout(() => { + expect(Tempassert).assertEqual("onConnect"); + }, 500) }, 4000) + done(); + console.log("------------end FreeInstall_FA_ConnectAbility_2000-------------"); }); } ) diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets index 4b96cf84a75f83aeaa3b2ac342f3f5fb0a16e776..eb881f329b0e0e150018be662d788eb9fae51037 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,436 +14,437 @@ * limitations under the License. */ - import { describe, beforeAll, afterEach, it, expect } from "@ohos/hypium" - import featureAbility from '@ohos.ability.featureAbility'; - import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - import commonEvent from '@ohos.commonEvent'; - - export default function connectAbilityTest_PA() { - let TAG = ""; - let dataAssert = ""; - let abilityDelegator = undefined - let subscriber; - let subscribeInfo = { - events: ["service_event", "service2_event", "service3_event", "service4_event", "service5_event", - "service6_event", "service7_event", "service8_event", "service9_event", "service10_event", "service11_event"] - }; - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - async function startService(msg, str) { - console.info(msg + ' startService successful. str: ' + JSON.stringify(str)); - featureAbility.startAbility(str) - .then((data) => { - console.info(msg + ' startService successful. Data: ' + JSON.stringify(data)); - }).catch((error) => { - console.error(msg + ' startService failed. Cause: ' + JSON.stringify(error)); - }) - } - - function checkParameters(msg1, data) { - for (let key in data.parameters) { - console.info(msg1 + " data.parameters is : " + data.parameters[key]) - if (data.parameters[key] === "onFailed") { - dataAssert = "onFailed"; - } else if (data.parameters[key] === "onDisconnect") { - dataAssert = "onDisconnect"; - } else if (data.parameters[key] === "onConnect") { - dataAssert = "onConnect"; - } - } - } - - function SubscribeCallBack(err, data) { - if (err.code) { - console.error("commonEvent subscribe failed " + JSON.stringify(err)); - } else { - if (data.event === "service_event") { - console.info("commonEvent subscribe service " + JSON.stringify(data)); - checkParameters("commonEvent service", data) - } else if (data.event === "service2_event") { - console.info("commonEvent subscribe service2 " + JSON.stringify(data)); - checkParameters("commonEvent service2", data) - } else if (data.event === "service3_event") { - console.info("commonEvent subscribe service3 " + JSON.stringify(data)); - checkParameters("commonEvent service3", data) - } else if (data.event === "service4_event") { - console.info("commonEvent subscribe service4 " + JSON.stringify(data)); - checkParameters("commonEvent service4", data) - } else if (data.event === "service5_event") { - console.info("commonEvent subscribe service5 " + JSON.stringify(data)); - checkParameters("commonEvent service5", data) - } else if (data.event === "service6_event") { - console.info("commonEvent subscribe service6 " + JSON.stringify(data)); - checkParameters("commonEvent service6", data) - } else if (data.event === "service7_event") { - console.info("commonEvent subscribe service7 " + JSON.stringify(data)); - checkParameters("commonEvent service7", data) - } else if (data.event === "service8_event") { - console.info("commonEvent subscribe service8 " + JSON.stringify(data)); - checkParameters("commonEvent service8", data) - } else if (data.event === "service9_event") { - console.info("commonEvent subscribe service9 " + JSON.stringify(data)); - checkParameters("commonEvent service9", data) - } else if (data.event === "service10_event") { - console.info("commonEvent subscribe service10 " + JSON.stringify(data)); - checkParameters("commonEvent service10", data) - } else if (data.event === "service11_event") { - console.info("commonEvent subscribe service11 " + JSON.stringify(data)); - checkParameters("commonEvent service11", data) - } - } - } - - - function CreateSubscriberCallBack(err, commonEventSubscriber) { - if (err.code) { - console.error("commonEvent createSubscriber failed " + JSON.stringify(err)); - } else { - console.info("----commonEvent createSubscriber------"); - subscriber = commonEventSubscriber; - commonEvent.subscribe(subscriber, SubscribeCallBack); - } - } - - describe('FreeInstall_FA_ConnectAbility_PA', function () { - beforeAll(async function (done) { - console.info("FreeInstall_FA_ConnectAbility_PA before all called"); - console.info("FreeInstall_FA_ConnectAbility_PA commonEvent.createSubscriber start!!!"); - commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack); - await sleep(2000); - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - let cmd = "bm install -p data/test/MockService.hap"; - console.info("cmd : " + cmd) - abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - - }) - await sleep(500); - let cmdum = "bm uninstall -n com.example.different.hmservice"; - abilityDelegator.executeShellCommand(cmdum, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - done(); - }) - }); - - afterEach(async function (done) { - console.info("FreeInstall_FA_ConnectAbility_PA after each called"); - dataAssert = "" - if ("FreeInstall_FA_ConnectAbility_PA_1100" === TAG) { - let cmd14 = "bm uninstall -n com.ohos.hag.famanager"; - abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => { - console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(2000) - } - done(); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0100 - * @tc.name Deviceid is empty,atomic service does not exist locally +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" +import featureAbility from '@ohos.ability.featureAbility'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import commonEvent from '@ohos.commonEvent'; + +export default function connectAbilityTest_PA() { + var TAG = ""; + var dataAssert = ""; + var abilityDelegator = undefined + var subscriber; + var subscribeInfo = { + events: ["service_event", "service2_event", "service3_event", "service4_event", "service5_event", + "service6_event", "service7_event", "service8_event", "service9_event", "service10_event", "service11_event"] + }; + + function sleep(time) { + return new Promise((resolve) => setTimeout(resolve, time)) + } + + async function startService(msg, str) { + console.info(msg + ' startService successful. str: ' + JSON.stringify(str)); + featureAbility.startAbility(str) + .then((data) => { + console.info(msg + ' startService successful. Data: ' + JSON.stringify(data)); + }).catch((error) => { + console.error(msg + ' startService failed. Cause: ' + JSON.stringify(error)); + }) + } + + function checkParameters(msg1, data) { + for (var key in data.parameters) { + console.info(msg1 + " data.parameters is : " + data.parameters[key]) + if (data.parameters[key] === "onFailed") { + dataAssert = "onFailed"; + } else if (data.parameters[key] === "onDisconnect") { + dataAssert = "onDisconnect"; + } else if (data.parameters[key] === "onConnect") { + dataAssert = "onConnect"; + } + } + } + + function SubscribeCallBack(err, data) { + if (err.code) { + console.error("commonEvent subscribe failed " + JSON.stringify(err)); + } else { + if (data.event === "service_event") { + console.info("commonEvent subscribe service " + JSON.stringify(data)); + checkParameters("commonEvent service", data) + } else if (data.event === "service2_event") { + console.info("commonEvent subscribe service2 " + JSON.stringify(data)); + checkParameters("commonEvent service2", data) + } else if (data.event === "service3_event") { + console.info("commonEvent subscribe service3 " + JSON.stringify(data)); + checkParameters("commonEvent service3", data) + } else if (data.event === "service4_event") { + console.info("commonEvent subscribe service4 " + JSON.stringify(data)); + checkParameters("commonEvent service4", data) + } else if (data.event === "service5_event") { + console.info("commonEvent subscribe service5 " + JSON.stringify(data)); + checkParameters("commonEvent service5", data) + } else if (data.event === "service6_event") { + console.info("commonEvent subscribe service6 " + JSON.stringify(data)); + checkParameters("commonEvent service6", data) + } else if (data.event === "service7_event") { + console.info("commonEvent subscribe service7 " + JSON.stringify(data)); + checkParameters("commonEvent service7", data) + } else if (data.event === "service8_event") { + console.info("commonEvent subscribe service8 " + JSON.stringify(data)); + checkParameters("commonEvent service8", data) + } else if (data.event === "service9_event") { + console.info("commonEvent subscribe service9 " + JSON.stringify(data)); + checkParameters("commonEvent service9", data) + } else if (data.event === "service10_event") { + console.info("commonEvent subscribe service10 " + JSON.stringify(data)); + checkParameters("commonEvent service10", data) + } else if (data.event === "service11_event") { + console.info("commonEvent subscribe service11 " + JSON.stringify(data)); + checkParameters("commonEvent service11", data) + } + } + } + + + function CreateSubscriberCallBack(err, commonEventSubscriber) { + if (err.code) { + console.error("commonEvent createSubscriber failed " + JSON.stringify(err)); + } else { + console.info("----commonEvent createSubscriber------"); + subscriber = commonEventSubscriber; + commonEvent.subscribe(subscriber, SubscribeCallBack); + } + } + + describe('FreeInstall_FA_ConnectAbility_PA', function () { + beforeAll(async function (done) { + console.info("FreeInstall_FA_ConnectAbility_PA before all called"); + console.info("FreeInstall_FA_ConnectAbility_PA commonEvent.createSubscriber start!!!"); + commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack); + await sleep(2000); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var cmd = "bm install -p data/test/MockService.hap"; + console.info("cmd : " + cmd) + abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { + console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + await sleep(500); + var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; + abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => { + console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + await sleep(500); + var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; + abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => { + console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + + }) + await sleep(500); + var cmdum = "bm uninstall -n com.example.different.hmservice"; + abilityDelegator.executeShellCommand(cmdum, (err: any, d: any) => { + console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + done(); + }) + }); + + afterEach(async function (done) { + console.info("FreeInstall_FA_ConnectAbility_PA after each called"); + dataAssert = "" + await sleep(1000); + if ("FreeInstall_FA_ConnectAbility_PA_1100" === TAG) { + var cmd14 = "bm uninstall -n com.ohos.hag.famanager"; + abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => { + console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + } + await sleep(500); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0100 + * @tc.name Deviceid is empty,atomic service does not exist locally + * @tc.desc Function test + * @tc.level 0 + */ + it("FreeInstall_FA_ConnectAbility_PA_0100", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0100-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0100"; + var cmdmyapp7 = "cp data/test/ConnectFaMyApplication7.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + + "haps/entry/files"; + abilityDelegator.executeShellCommand(cmdmyapp7, (err: any, d: any) => { + console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + setTimeout(async () => { + var str1 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility", + } + }; + startService(TAG, str1); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onConnect"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0100-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0200 + * @tc.name Deviceid is empty,atomic service exists locally * @tc.desc Function test * @tc.level 0 */ - it("FreeInstall_FA_ConnectAbility_PA_0100", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0100-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0100"; - let cmdmyapp7 = "cp data/test/ConnectFaMyApplication7.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - abilityDelegator.executeShellCommand(cmdmyapp7, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - let str1 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility", - } - }; - startService(TAG, str1); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0100-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0200 - * @tc.name Deviceid is empty,atomic service exists locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_ConnectAbility_PA_0200", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0200-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0200"; - let cmdapp9 = "bm install -p data/test/ConnectFaMyApplication9.hap"; - abilityDelegator.executeShellCommand(cmdapp9, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(2000) - let str2 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility2", - } - }; - startService(TAG, str2); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0200-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0300 - * @tc.name The bundleName passed in is different from the local - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_FA_ConnectAbility_PA_0300", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0300-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0300"; - let str3 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility3", - } - }; - startService(TAG, str3); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0300-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0400 - * @tc.name Do not pass flags, atomic service does not exist locally - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_FA_ConnectAbility_PA_0400", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0400-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0400"; - let str4 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility4", - } - }; - startService(TAG, str4); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0400-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0500 - * @tc.name Do not pass flags, atomic service exists locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_ConnectAbility_PA_0500", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0500-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0500"; - let cmdin = "bm install -p data/test/ConnectDifferentApplication.hap"; - abilityDelegator.executeShellCommand(cmdin, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(2000) - let str5 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility5", - } - }; - startService(TAG, str5); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0500-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0600 - * @tc.name Incorrect deviceid passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_FA_ConnectAbility_PA_0600", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0600-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0600"; - let str6 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility6", - } - }; - startService(TAG, str6); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0600-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0700 - * @tc.name Incorrect bundleName passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_FA_ConnectAbility_PA_0700", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0700-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0700"; - - let str7 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility7", - } - }; - startService(TAG, str7); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0700-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0800 - * @tc.name Pass in an empty abilityName - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_FA_ConnectAbility_PA_0800", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0800-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0800"; - - let str8 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility8", - } - }; - startService(TAG, str8); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0800-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_0900 - * @tc.name No atomic service under path - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_FA_ConnectAbility_PA_0900", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_0900-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_0900"; - let cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*"; - abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - - await sleep(500); - let str9 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility9", - } - }; - startService(TAG, str9); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_0900-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_1000 - * @tc.name Incorrect moduleName passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_FA_ConnectAbility_PA_1000", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_1000-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_1000"; - - let str10 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility10", - } - }; - startService(TAG, str10); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_1000-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_ConnectAbility_PA_1100 - * @tc.name Pass in parameters - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_ConnectAbility_PA_1100", 0, async function (done) { - console.log("------------start FreeInstall_FA_ConnectAbility_PA_1100-------------"); - TAG = "FreeInstall_FA_ConnectAbility_PA_1100"; - let cmdmyapp8 = "cp data/test/ConnectFaMyApplication8.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - abilityDelegator.executeShellCommand(cmdmyapp8, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - let str11 = { - "want": { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility11", - } - }; - startService(TAG, str11); - setTimeout(() => { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_FA_ConnectAbility_PA_1100-------------"); - done() - }, 4000); - }); - } - ) - } \ No newline at end of file + it("FreeInstall_FA_ConnectAbility_PA_0200", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0200-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0200"; + var cmdapp9 = "bm install -p data/test/ConnectFaMyApplication9.hap"; + abilityDelegator.executeShellCommand(cmdapp9, (err: any, d: any) => { + console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + setTimeout(async () => { + var str2 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility2", + } + }; + startService(TAG, str2); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onConnect"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0200-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0300 + * @tc.name The bundleName passed in is different from the local + * @tc.desc Function test + * @tc.level 1 + */ + it("FreeInstall_FA_ConnectAbility_PA_0300", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0300-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0300"; + setTimeout(async () => { + var str3 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility3", + } + }; + startService(TAG, str3); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onFailed"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0300-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0400 + * @tc.name Do not pass flags, atomic service does not exist locally + * @tc.desc Function test + * @tc.level 1 + */ + it("FreeInstall_FA_ConnectAbility_PA_0400", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0400-------------"); + setTimeout(async () => { + TAG = "FreeInstall_FA_ConnectAbility_PA_0400"; + var str4 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility4", + } + }; + startService(TAG, str4); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onFailed"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0400-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0500 + * @tc.name Do not pass flags, atomic service exists locally + * @tc.desc Function test + * @tc.level 0 + */ + it("FreeInstall_FA_ConnectAbility_PA_0500", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0500-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0500"; + var cmdin = "bm install -p data/test/ConnectDifferentApplication.hap"; + abilityDelegator.executeShellCommand(cmdin, (err: any, d: any) => { + console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + setTimeout(async () => { + var str5 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility5", + } + }; + startService(TAG, str5); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onConnect"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0500-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0600 + * @tc.name Incorrect deviceid passed in + * @tc.desc Function test + * @tc.level 1 + */ + it("FreeInstall_FA_ConnectAbility_PA_0600", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0600-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0600"; + setTimeout(async () => { + var str6 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility6", + } + }; + startService(TAG, str6); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onFailed"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0600-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0700 + * @tc.name Incorrect bundleName passed in + * @tc.desc Function test + * @tc.level 1 + */ + it("FreeInstall_FA_ConnectAbility_PA_0700", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0700-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0700"; + + setTimeout(async () => { + var str7 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility7", + } + }; + startService(TAG, str7); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onFailed"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0700-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0800 + * @tc.name Pass in an empty abilityName + * @tc.desc Function test + * @tc.level 1 + */ + it("FreeInstall_FA_ConnectAbility_PA_0800", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0800-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0800"; + + setTimeout(async () => { + var str8 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility8", + } + }; + startService(TAG, str8); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onFailed"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0800-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_0900 + * @tc.name No atomic service under path + * @tc.desc Function test + * @tc.level 1 + */ + it("FreeInstall_FA_ConnectAbility_PA_0900", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_0900-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_0900"; + var cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*"; + abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => { + console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + + setTimeout(async () => { + await sleep(500); + var str9 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility9", + } + }; + startService(TAG, str9); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onFailed"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_0900-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_1000 + * @tc.name Incorrect moduleName passed in + * @tc.desc Function test + * @tc.level 1 + */ + it("FreeInstall_FA_ConnectAbility_PA_1000", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_1000-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_1000"; + + setTimeout(async () => { + var str10 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility10", + } + }; + startService(TAG, str10); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onFailed"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_1000-------------"); + }, 4000); + done(); + }); + + /* + * @tc.number FreeInstall_FA_ConnectAbility_PA_1100 + * @tc.name Pass in parameters + * @tc.desc Function test + * @tc.level 0 + */ + it("FreeInstall_FA_ConnectAbility_PA_1100", 0, async function (done) { + console.log("------------start FreeInstall_FA_ConnectAbility_PA_1100-------------"); + TAG = "FreeInstall_FA_ConnectAbility_PA_1100"; + var cmdmyapp8 = "cp data/test/ConnectFaMyApplication8.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + + "haps/entry/files"; + abilityDelegator.executeShellCommand(cmdmyapp8, (err: any, d: any) => { + console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); + }) + + setTimeout(async () => { + var str11 = { + "want": { + "bundleName": "com.example.myapplication.hmservice", + "abilityName": "com.example.myapplication.ServiceAbility11", + } + }; + startService(TAG, str11); + console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); + expect(dataAssert).assertEqual("onConnect"); + console.log("------------end FreeInstall_FA_ConnectAbility_PA_1100-------------"); + }, 4000); + done(); + }); + } + ) +} + diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 9cd0c5abef23f04446dace09224b5b25b60958af..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility feature onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility feature op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility different onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility different onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility different onConnect'); - console.info('stage_connectAbility connect different success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility different onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility different onReconnect'); - } - onDestroy() { - console.info('ServiceAbility different onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json index d50e2645fba1da8b57d8de918d4fb0ad625f979e..cb9cf615b3f499507b209252d76bcb766325ee65 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:entry_desc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": true, @@ -33,18 +33,6 @@ } ] } - ], - "extensionAbilities": [ - { - "name": "com.example.different.ServiceAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_FormAbility_label", - "description": "$string:form_FormAbility_desc", - "type": "service", - "visible": true, - "icon": "$media:icon" - - } ] } } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..cefa22e042c41aeb0ad8f1e6cb583fca72b3ed3a 100755 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce643db62436e6298ad2091ff9d677efe2b0287c 100644 Binary files a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/BUILD.gn deleted file mode 100644 index a66bdcbb6e80635f870b7f08bb859f4effffcee1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsFreeInstallConnectAbilityStageTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsfreeinstallconnectabilitystagetest_js_assets", - ":actsfreeinstallconnectabilitystagetest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsFreeInstallConnectAbilityStageTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsfreeinstallconnectabilitystagetest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsfreeinstallconnectabilitystagetest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsfreeinstallconnectabilitystagetest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsfreeinstallconnectabilitystagetest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/Test.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/Test.json deleted file mode 100644 index fb80657451240e232a3db02b2579135a3d737a88..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/Test.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": "Configuration for freeinstallconnectabilitystagetest Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "600000", - "bundle-name": "com.example.myapplication.hmservice", - "module-name": "entry", - "shell-timeout": "600000", - "testcase-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFreeInstallConnectAbilityStageTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount", - "mkdir /data/test/" - ] - }, - { - "type": "PushKit", - "push":[ - "MockService.hap -> /data/test/MockService.hap", - "ConnectStageMyApplication0.hap -> /data/test/ConnectStageMyApplication0.hap", - "ConnectStageMyApplication1.hap -> /data/test/ConnectStageMyApplication1.hap", - "ConnectStageMyApplication2.hap -> /data/test/ConnectStageMyApplication2.hap", - "ConnectStageMyApplication3.hap -> /data/test/ConnectStageMyApplication3.hap", - "ConnectStageMyApplication4.hap -> /data/test/ConnectStageMyApplication4.hap", - "ConnectStageMyApplication5.hap -> /data/test/ConnectStageMyApplication5.hap", - "ConnectStageMyApplication6.hap -> /data/test/ConnectStageMyApplication6.hap", - "ConnectStageMyApplication7.hap -> /data/test/ConnectStageMyApplication7.hap", - "ConnectStageMyApplication8.hap -> /data/test/ConnectStageMyApplication8.hap", - "ConnectDifferentApplication.hap -> /data/test/ConnectDifferentApplication.hap" - ] - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 1a3520c5fdf05c12686e1e1ae5929e29e1f07173..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' -import commonEvent from '@ohos.commonEvent'; - -let publishOptions = { - parameters: { - "assertData": "onconnect" - } -}; -function PublishCallBack(err) { - if (err.code) { - console.error("Testevent service publish failed " + JSON.stringify(err)); - } else { - console.info("Testevent service publish success!!!"); - } -} - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") -// commonEvent.publish("test_event",publishOptions,PublishCallBack); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 6e87e2098e60ad3ec6ccb53c699a32dbfb7dc3ac..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/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.app.ability.UIAbility' - -export default class MainAbility2 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.ability2 = this.context; - windowStage.setUIContent(this.context, "pages/index2", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - setTimeout(function () { - globalThis.ability2.terminateSelf() - .then((data) => { - console.info('[Demo] MainAbility2 terminateself succeeded: ' + data); - }).catch((error) => { - console.error('[Demo] MainAbility2 terminateself failed. Cause: ' + error); - }) - }, 3200); - - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index e88f22b318e080fadfb3b68f5f2410bb81ebb5a1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,87 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service publish success!!!"); - } -} - -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service onRequest'); - let request = { - 'deviceId': '', - 'bundleName': 'com.example.myapplication.hmservice', - 'abilityName': 'ServiceAbility6', - 'moduleName': 'myapplication6', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service onConnect success!!!'); - commonEvent.publish("service_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service onDisconnect success!!!'); - commonEvent.publish("service_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service onFailed!!!'); - commonEvent.publish("service_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 7c72d5a05412cc8d8458a804730483b474d456f2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,86 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service2 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service2 publish success!!!"); - } -} - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service2 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service2 onRequest'); - let request = { - 'bundleName': 'com.example.different.hmservice', - 'abilityName': 'com.example.different.ServiceAbility', - 'moduleName': 'entry', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service2 onConnect success!!!'); - commonEvent.publish("service2_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service2 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service2 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service2 onDisconnect success!!!'); - commonEvent.publish("service2_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service2 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service2 onFailed!!!'); - commonEvent.publish("service2_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service2 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service2 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service2 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service2 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service2 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility3/ServiceAbility3.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility3/ServiceAbility3.ts deleted file mode 100644 index 018516a050e294e6d5b71ea0bf823e406ef0449f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility3/ServiceAbility3.ts +++ /dev/null @@ -1,84 +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'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service3 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service3 publish success!!!"); - } -} - -export default class ServiceAbility3 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service3 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service3 onRequest'); - let request = { - 'bundleName': 'com.example.different.hmservice', - 'abilityName': 'com.example.different.ServiceAbility', - 'moduleName': 'entry', - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service3 onConnect success!!!'); - commonEvent.publish("service3_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service3 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service3 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service3 onDisconnect success!!!'); - commonEvent.publish("service3_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service3 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service3 onFailed!!!'); - commonEvent.publish("service3_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service3 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service3 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service3 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service3 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service3 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility4/ServiceAbility4.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility4/ServiceAbility4.ts deleted file mode 100644 index 6ab25ab7a168b2e2be0a44250d2ec41679303c25..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility4/ServiceAbility4.ts +++ /dev/null @@ -1,87 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service4 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service4 publish success!!!"); - } -} - -export default class ServiceAbility4 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service4 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service4 onRequest'); - let request = { - 'deviceId': 'XXXXX', - 'bundleName': 'com.example.myapplication.hmservice', - 'abilityName': 'ServiceAbility7', - 'moduleName': 'myapplication7', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service4 onConnect success!!!'); - commonEvent.publish("service4_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service4 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service4 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service4 onDisconnect success!!!'); - commonEvent.publish("service4_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service4 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service4 onFailed!!!'); - commonEvent.publish("service4_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service4 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service4 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service4 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service4 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service4 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility5/ServiceAbility5.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility5/ServiceAbility5.ts deleted file mode 100644 index 78e1001a0ecef30cce9f35fb037dad5bb62efda0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility5/ServiceAbility5.ts +++ /dev/null @@ -1,86 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service5 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service5 publish success!!!"); - } -} - -export default class ServiceAbility4 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service5 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service5 onRequest'); - let request = { - 'bundleName': 'com.example.xxx.hmservice', - 'abilityName': 'ServiceAbility7', - 'moduleName': 'myapplication7', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service5 onConnect success!!!'); - commonEvent.publish("service5_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service5 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service5 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service5 onDisconnect success!!!'); - commonEvent.publish("service5_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service5 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service5 onFailed!!!'); - commonEvent.publish("service5_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service5 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service5 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service5 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service5 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service5 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility6/ServiceAbility6.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility6/ServiceAbility6.ts deleted file mode 100644 index 328007605de6873f0fbc00ceba1cc37b771b5dd3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility6/ServiceAbility6.ts +++ /dev/null @@ -1,86 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service6 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service6 publish success!!!"); - } -} - -export default class ServiceAbility4 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service6 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service6 onRequest'); - let request = { - 'bundleName': 'com.example.myapplication.hmservice', - 'abilityName': '', - 'moduleName': 'myapplication7', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service6 onConnect success!!!'); - commonEvent.publish("service6_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service6 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service6 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service6 onDisconnect success!!!'); - commonEvent.publish("service6_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service6 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service6 onFailed!!!'); - commonEvent.publish("service6_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service6 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service6 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service6 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service6 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service6 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility7/ServiceAbility7.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility7/ServiceAbility7.ts deleted file mode 100644 index 88229fa85e7527980e80cf1dc6200ffc783b66a2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility7/ServiceAbility7.ts +++ /dev/null @@ -1,89 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service7 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service7 publish success!!!"); - } -} - -export default class ServiceAbility4 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service7 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service7 onRequest'); - let request = { - 'bundleName': 'com.example.myapplication.hmservice', - 'abilityName': 'ServiceAbility7', - 'moduleName': 'myapplication7', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - 'parameters': { - "key1": "value1", "key2": "let your heart guide you", "tag": "Every ending is a new beginning!" - } - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service7 onConnect success!!!'); - commonEvent.publish("service7_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service7 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service7 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service7 onDisconnect success!!!'); - commonEvent.publish("service7_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service7 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service7 onFailed!!!'); - commonEvent.publish("service7_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service7 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service7 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service7 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service7 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service7 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility8/ServiceAbility8.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility8/ServiceAbility8.ts deleted file mode 100644 index ee6427eab5d6a1c32c6ab2d02295768662e0d37f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility8/ServiceAbility8.ts +++ /dev/null @@ -1,86 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service8 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service8 publish success!!!"); - } -} - -export default class ServiceAbility4 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service8 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service8 onRequest'); - let request = { - 'bundleName': 'com.example.myapplication.hmservice', - 'abilityName': 'ServiceAbility7', - 'moduleName': 'xxxxx', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service8 onConnect success!!!'); - commonEvent.publish("service8_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service8 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service8 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service8 onDisconnect success!!!'); - commonEvent.publish("service8_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service8 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service8 onFailed!!!'); - commonEvent.publish("service8_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service8 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service8 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service8 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service8 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service8 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility9/ServiceAbility9.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility9/ServiceAbility9.ts deleted file mode 100644 index 83d01c29cc7e79222970b67004fe92f94886235a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility9/ServiceAbility9.ts +++ /dev/null @@ -1,86 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishConnectOptions = { - parameters: { - "assertData": "onConnect" - } -}; -var publishDisconnectOptions = { - parameters: { - "assertData": "onDisconnect" - } -}; -var publishFailedOptions = { - parameters: { - "assertData": "onFailed" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service9 publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service9 publish success!!!"); - } -} - -export default class ServiceAbility4 extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ConnectAbilityTest_Ext service9 onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ConnectAbilityTest_Ext service9 onRequest'); - let request = { - 'bundleName': 'com.example.myapplication.hmservice', - 'abilityName': 'ServiceAbility6', - 'moduleName': 'myapplication8', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.info('ConnectAbilityTest_Ext service9 onConnect success!!!'); - commonEvent.publish("service9_event",publishConnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service9 onConnect element : ' + JSON.stringify(element)); - console.info('ConnectAbilityTest_Ext service9 onConnect proxy : ' + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.info('ConnectAbilityTest_Ext service9 onDisconnect success!!!'); - commonEvent.publish("service9_event",publishDisconnectOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service9 onDisconnect element : ' + JSON.stringify(element1)); - }, - onFailed: async function (code: any) { - console.info('ConnectAbilityTest_Ext service9 onFailed!!!'); - commonEvent.publish("service9_event",publishFailedOptions,PublishCallBack); - console.info('ConnectAbilityTest_Ext service9 onFailed errCode : ' + JSON.stringify(code)); - }, - } - console.info('ConnectAbilityTest_Ext sevice connect start '); - var connection = this.context.connectAbility(request, options); - console.info('ConnectAbilityTest_Ext service9 request is:' + JSON.stringify(request)); - console.info('ConnectAbilityTest_Ext service9 options is:' + JSON.stringify(options)); - console.info('ConnectAbilityTest_Ext service9 connection=: ' + connection); - } - onDestroy() { - console.info('ConnectAbilityTest_Ext service9 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 28b63ae323260a1c50537460cc23308796714f81..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout','-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -a' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - globalThis.delegator = abilityDelegator; - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets deleted file mode 100644 index cd2173be0de6d813e2210aeec8d3905d8ca0a62f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets +++ /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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/ListTest' - -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - aboutToAppear() { - console.info("start run testcase!!!!") - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index2.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index2.ets deleted file mode 100644 index 0f7c38d7b690ce2c7ce57fbaac28a908fecfb518..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index2.ets +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index2 { - @State message: string = 'Hello MainAbility2' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets deleted file mode 100644 index cba5808116d39e8c0989fc0e2c1c87b49173b0f5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets +++ /dev/null @@ -1,746 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import rpc from '@ohos.rpc'; -import wantConstant from '@ohos.ability.wantConstant' -import Prompt from '@system.prompt'; -import abilityManager from '@ohos.application.abilityManager'; - - -export default function ConnectAbilityTest(abilityContext) { - var TAG = ""; - var Tempassert = ""; - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - describe('ConnectAbilityTest', function () { - beforeAll(async function (done) { - console.info("ConnectAbilityTest before all called"); - var cmd = "bm install -p data/test/MockService.hap"; - console.info("cmd : " + cmd) - globalThis.delegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - globalThis.delegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - globalThis.delegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - done(); - }) - }); - - afterEach(async function (done) { - console.info("ConnectAbilityTest after each called"); - Tempassert = "" - await sleep(1000); - done(); - }); - - function tips(msg) { - Prompt.showToast({ - message: msg, - duration: 2000, - bottom: '150px' - }); - } - - async function connectabillity(msg, request) { - console.info(msg + "START"); - let options = { - onConnect: function (element, proxy) { - console.info("FreeInstall_Stage_ConnectAbility onConnect success!!!") - console.info(msg + " onConnect success!!! "); - console.info(msg + " onConnect: " + JSON.stringify(element)); - console.info(msg + " onConnect: " + JSON.stringify(proxy)); - if (proxy == null) { - console.error("FreeInstall_Stage_ConnectAbility proxy null"); - return; - } - let option = new rpc.MessageOption(); - let data = new rpc.MessageParcel(); - let reply = new rpc.MessageParcel(); - data.writeInterfaceToken("ohos.appexecfwk.IApplicationStateObserver"); - proxy.sendRequest(0, data, reply, option); - Tempassert = "onConnect"; - tips("连接成功"); - }, - onDisconnect: function (element) { - console.info("FreeInstall_Stage_ConnectAbility onDisconnect success!!!") - console.info(msg + " onDisconnect success!!!"); - console.info(msg + " onDisconnect: " + JSON.stringify(element)); - Tempassert = "onDisconnect"; - tips("连接断开"); - }, - onFailed: function (code) { - console.info("FreeInstall_Stage_ConnectAbility onFailed!!!") - console.info(msg + " onFailed!!! "); - console.info(msg + " onFailed: " + JSON.stringify(code)); - Tempassert = "onFailed"; - tips("连接失败"); - } - } - let connection = await globalThis.abilityContext.connectServiceExtensionAbility(request, options); - console.info(msg + "request:" + JSON.stringify(request)); - console.info(msg + "options:" + JSON.stringify(options)); - console.info(msg + "connection=" + JSON.stringify(connection)); - console.info(msg + "END"); - } - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0100 - * @tc.name Pass in the local deviceid,atomic service does not exist locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_0100", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0100-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0100"; - var cmd4 = "cp data/test/ConnectStageMyApplication0.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmd4, (err: any, d: any) => { - console.info("executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var deviceid = "0"; - abilityManager.getTopAbility((err, data) => { - console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); - console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId)); - deviceid = data.deviceId; - }) - await sleep(500); - var request1 = { - "deviceId": deviceid, - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility", - "moduleName": "myapplication", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request1); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0100-------------"); - done(); - }, 3000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0200 - * @tc.name Pass in the local deviceid,atomic service exists locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_0200", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0200-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0200"; - var deviceid = "0"; - abilityManager.getTopAbility((err, data) => { - console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); - console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId)); - deviceid = data.deviceId; - }) - await sleep(500); - var request2 = { - "deviceId": deviceid, - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility", - "moduleName": "myapplication", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request2); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0200-------------"); - done(); - }, 3000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0300 - * @tc.name Deviceid is empty,atomic service does not exist locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_0300", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0300-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0300"; - var cmd3 = "cp data/test/ConnectStageMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmd3, (err: any, d: any) => { - console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var request3 = { - "deviceId": "", - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility_feature", - "moduleName": "myapplication1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request3); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0300-------------"); - done(); - }, 3000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0400 - * @tc.name Deviceid is empty,atomic service exists locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_0400", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0400-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0400"; - var request4 = { - "deviceId": "", - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility_feature", - "moduleName": "myapplication1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request4); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0400-------------"); - done(); - }, 3000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0500 - * @tc.name The bundleName passed in is different from the local - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_0500", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0500-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0500"; - var request5 = { - "bundleName": "com.example.different.hmservice", - "abilityName": "com.example.different.ServiceAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request5); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0500-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0600 - * @tc.name Pass in an empty bundleName - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_0600", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0600-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0600"; - var request6 = { - "bundleName": "", - "abilityName": "ServiceAbility_feature", - "moduleName": "myapplication1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request6); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0600-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0700 - * @tc.name Pass in an empty abilityName - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_0700", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0700-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0700"; - var request7 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "", - "moduleName": "myapplication1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request7); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0700-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0800 - * @tc.name Incorrect deviceid passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_0800", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0800-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0800"; - var request8 = { - "deviceId": "xxxxxx", - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility2", - "moduleName": "myapplication2", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request8); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0800-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_0900 - * @tc.name Incorrect bundleName passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_0900", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_0900-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_0900"; - var request9 = { - "bundleName": "com.example.xxx.hmservice", - "abilityName": "ServiceAbility2", - "moduleName": "myapplication2", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request9); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_0900-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1000 - * @tc.name Incorrect flags passed in,atomic service does not exist locally - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1000", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1000-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1000"; - var request10 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility2", - "moduleName": "myapplication2", - "flags": 1111111, - } - connectabillity(TAG, request10); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1000-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1100 - * @tc.name Incorrect flags passed in,atomic service exists locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_1100", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1100-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1100"; - var cmdapp2 = "bm install -p data/test/ConnectStageMyApplication2.hap"; - globalThis.delegator.executeShellCommand(cmdapp2, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var request11 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility2", - "moduleName": "myapplication2", - "flags": "11", - } - connectabillity(TAG, request11); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1000-------------"); - done(); - }, 3000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1200 - * @tc.name No atomic service under path - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1200", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1200-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1200"; - var cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*"; - globalThis.delegator.executeShellCommand(cmdrm, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var request12 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility3", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request12); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1200-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1300 - * @tc.name The application is not in the foreground [start MainAbility2 first, then connect] - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1300", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1300-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1300"; - var str = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.MainAbility2", - } - console.info(TAG + " startmainability2 str: " + JSON.stringify(str)); - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + " startmainability2 successful. Data: " + JSON.stringify(data)) - }).catch((error) => { - console.error(TAG + " startmainability2 failed. Cause: " + JSON.stringify(error)); - }) - await sleep(1500); - var request13 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility3", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request13); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1300-------------"); - done(); - }, 1500); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1400 - * @tc.name The application is not in the foreground [start myapp2 first, then connect] - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1400", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1400-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1400"; - var str = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "MainAbility_myapp2", - } - console.info(TAG + " startmyapp2 str: " + JSON.stringify(str)); - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + " startmyapp2 successful. Data: " + JSON.stringify(data)) - }).catch((error) => { - console.error(TAG + " startmyapp2 failed. Cause: " + JSON.stringify(error)); - }) - await sleep(1500); - var request14 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility3", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request14); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1400-------------"); - done(); - }, 1500); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1500 - * @tc.name The application is not in the foreground, - [start another project first, then connect,atomic service does not exist locally] - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1500", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1500-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1500"; - var cmddif = "bm install -p data/test/ConnectDifferentApplication.hap"; - globalThis.delegator.executeShellCommand(cmddif, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var str = { - "bundleName": "com.example.different.hmservice", - "abilityName": "MainAbility", - }; - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + " startother successful. Data: " + JSON.stringify(data)) - }).catch((error) => { - console.error(TAG + " startother failed. Cause: " + JSON.stringify(error)); - }) - await sleep(1500); - var request15 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility4", - "moduleName": "myapplication4", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request15); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1500-------------"); - done(); - }, 1500); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1600 - * @tc.name The application is not in the foreground, - [start another project first, then connect,atomic service exists locally] - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1600", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1600-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1600"; - var cmdmyapp4 = "bm install -p data/test/ConnectStageMyApplication4.hap"; - globalThis.delegator.executeShellCommand(cmdmyapp4, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var str = { - "bundleName": "com.example.different.hmservice", - "abilityName": "MainAbility", - }; - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + " startother successful. Data: " + JSON.stringify(data)) - }).catch((error) => { - console.error(TAG + " startother failed. Cause: " + JSON.stringify(error)); - }) - await sleep(1500); - var request16 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility4", - "moduleName": "myapplication4", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request16); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1600-------------"); - done(); - }, 1500); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1700 - * @tc.name Do not pass flags, connect to the service of another project - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_1700", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1700-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1700"; - var request17 = { - "bundleName": "com.example.different.hmservice", - "abilityName": "com.example.different.ServiceAbility", - "moduleName": "entry", - } - connectabillity(TAG, request17); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1700-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1800 - * @tc.name Incorrect moduleName passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1800", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1800-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1800"; - var request18 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility3", - "moduleName": "xxxxx", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request18); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1800-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_1900 - * @tc.name The target is atomized as hapA, and hapB is placed under the path - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_1900", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_1900-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_1900"; - var cmdmyapp5 = "cp data/test/ConnectStageMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var request19 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility3", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request19); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_1900-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_2000 - * @tc.name Pass in parameters - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_2000", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_2000-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_2000"; - var cmdmyapp5 = "cp data/test/ConnectStageMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var request20 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility5", - "moduleName": "myapplication5", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - "parameters": { "name": 1111, "key1": "value1", "site": "nice to meet you!" }, - } - connectabillity(TAG, request20); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_2000-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_2100 - * @tc.name The atomic service of the target differs only by moduleName - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_2100", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_2100-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_2100"; - var cmdmyapp5 = "cp data/test/ConnectStageMyApplication3.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var request21 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility_feature", - "moduleName": "myapplication3", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request21); - setTimeout(function () { - expect(Tempassert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_2100-------------"); - done(); - }, 2000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_2200 - * @tc.name The application is not in the foreground, - [the current application is in the background first,then connect] - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_2200", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_2200-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_2200"; - var ability; - globalThis.delegator.getCurrentTopAbility((err : any, data : any) => { - console.info(TAG + " getCurrentTopAbility data: " + JSON.stringify(data) + " ,err: " + JSON.stringify(err)); - ability = data; - globalThis.delegator.doAbilityBackground(ability, (err : any, data : any) => { - console.info(TAG + " doAbilityBackground data: " + JSON.stringify(data) + " ,err: " + JSON.stringify(err)); - }) - }); - await sleep(1000); - var request22 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "ServiceAbility6", - "moduleName": "myapplication6", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - connectabillity(TAG, request22); - setTimeout(function () { - expect(Tempassert).assertEqual("onFailed"); - globalThis.delegator.doAbilityForeground(ability, (err : any, data : any) => { - console.info(TAG + " doAbilityForeground data: " + JSON.stringify(data) + " ,err: " + JSON.stringify(err)); - }) - console.log("------------end FreeInstall_Stage_ConnectAbility_2200-------------"); - done(); - }, 4000); - }); - } - ) -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets deleted file mode 100644 index 48b982f48d405089c00967af5e811294625eef87..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets +++ /dev/null @@ -1,439 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import commonEvent from '@ohos.commonEvent'; - -export default function ConnectAbilityTest_Ext(abilityContext) { - var TAG = ""; - var dataAssert = ""; - var subscriber; - var subscribeInfo = { - events: ["service_event", "service2_event", "service3_event", - "service4_event", "service5_event", "service6_event", - "service7_event", "service8_event", "service9_event"] - }; - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - async function startService(msg, str) { - console.info(msg + ' startService successful. str: ' + JSON.stringify(str)); - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(msg + ' startService successful. Data: ' + JSON.stringify(data)); - }).catch((error) => { - console.error(msg + ' startService failed. Cause: ' + JSON.stringify(error)); - }) - } - - function checkParameters(msg1, data) { - for (var key in data.parameters) { - console.info(msg1 + " data.parameters is : " + data.parameters[key]) - if (data.parameters[key] === "onFailed") { - dataAssert = "onFailed"; - } else if (data.parameters[key] === "onDisconnect") { - dataAssert = "onDisconnect"; - } else if (data.parameters[key] === "onConnect") { - dataAssert = "onConnect"; - } - } - } - - function SubscribeCallBack(err, data) { - if (err.code) { - console.error("commonEvent subscribe failed " + JSON.stringify(err)); - } else { - if (data.event === "service_event") { - console.info("commonEvent subscribe service " + JSON.stringify(data)); - checkParameters("commonEvent service", data) - } else if (data.event === "service2_event") { - console.info("commonEvent subscribe service2 " + JSON.stringify(data)); - checkParameters("commonEvent service2", data) - } else if (data.event === "service3_event") { - console.info("commonEvent subscribe service3 " + JSON.stringify(data)); - checkParameters("commonEvent service3", data) - } else if (data.event === "service4_event") { - console.info("commonEvent subscribe service4 " + JSON.stringify(data)); - checkParameters("commonEvent service4", data) - } else if (data.event === "service5_event") { - console.info("commonEvent subscribe service5 " + JSON.stringify(data)); - checkParameters("commonEvent service5", data) - } else if (data.event === "service6_event") { - console.info("commonEvent subscribe service6 " + JSON.stringify(data)); - checkParameters("commonEvent service6", data) - } else if (data.event === "service7_event") { - console.info("commonEvent subscribe service7 " + JSON.stringify(data)); - checkParameters("commonEvent service7", data) - } else if (data.event === "service8_event") { - console.info("commonEvent subscribe service8 " + JSON.stringify(data)); - checkParameters("commonEvent service8", data) - } else if (data.event === "service9_event") { - console.info("commonEvent subscribe service9 " + JSON.stringify(data)); - checkParameters("commonEvent service9", data) - } - } - } - - function CreateSubscriberCallBack(err, commonEventSubscriber) { - if (err.code) { - console.error("commonEvent createSubscriber failed " + JSON.stringify(err)); - } else { - console.info("----commonEvent createSubscriber------"); - subscriber = commonEventSubscriber; - commonEvent.subscribe(subscriber, SubscribeCallBack); - } - } - - describe('FreeInstall_Stage_ConnectAbility_Ext', function () { - beforeAll(async function (done) { - console.info("FreeInstall_Stage_ConnectAbility_Ext before all called"); - console.info("FreeInstall_Stage_ConnectAbility_Ext commonEvent.createSubscriber start!!!"); - commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack); - await sleep(2000); - var cmd = "bm install -p data/test/Mockservice.hap"; - console.info("cmd : " + cmd) - globalThis.delegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - globalThis.delegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - globalThis.delegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - done(); - }) - }); - - afterEach(async function (done) { - console.info("FreeInstall_Stage_ConnectAbility_Ext after each called"); - dataAssert = "" - await sleep(1000); - if ("FreeInstall_Stage_ConnectAbility_Ext_1200" === TAG) { - var cmdUninstall = "bm uninstall -n com.ohos.hag.famanager"; - globalThis.delegator.executeShellCommand(cmdUninstall, (err: any, d: any) => { - console.info("executeShellCommandUninstall : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - } - await sleep(500); - done(); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0100 - * @tc.name Deviceid is empty,atomic service does not exist locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0100", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0100-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0100"; - var cmdmyapp6 = "cp data/test/ConnectStageMyApplication6.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmdmyapp6, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var str1 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility", - }; - startService(TAG, str1); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0100-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0200 - * @tc.name Deviceid is empty,atomic service exists locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0200", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0200-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0200"; - var str1 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility", - }; - startService(TAG, str1); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0200-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0300 - * @tc.name The bundleName passed in is different from the local - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0300", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0300-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0300"; - var cmdum = "bm uninstall -n com.example.different.hmservice"; - globalThis.delegator.executeShellCommand(cmdum, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var str2 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility2", - }; - startService(TAG, str2); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0300-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0400 - * @tc.name Do not pass flags, atomic service does not exist locally - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0400", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0400-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0400"; - var str3 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility3", - }; - startService(TAG, str3); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0400-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0500 - * @tc.name Do not pass flags, atomic service exists locally - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0500", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0500-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0500"; - var cmdin = "bm install -p data/test/ConnectDifferentApplication.hap"; - globalThis.delegator.executeShellCommand(cmdin, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var str3 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility3", - }; - startService(TAG, str3); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0500-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0600 - * @tc.name Incorrect deviceid passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0600", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0600-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0600"; - var str4 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility4", - }; - startService(TAG, str4); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0600-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0700 - * @tc.name Incorrect bundleName passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0700", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0700-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0700"; - var str5 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility5", - }; - startService(TAG, str5); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0700-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0800 - * @tc.name Pass in an empty abilityName - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0800", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0800-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0800"; - var str6 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility6", - }; - startService(TAG, str6); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0800-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_0900 - * @tc.name No atomic service under path - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_0900", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_0900-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_0900"; - var cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*"; - globalThis.delegator.executeShellCommand(cmdrm, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var str7 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility7", - }; - startService(TAG, str7); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_0900-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_1000 - * @tc.name Incorrect moduleName passed in - * @tc.desc Function test - * @tc.level 1 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_1000", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_1000-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_1000"; - var str8 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility8", - }; - startService(TAG, str8); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onFailed"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_1000-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_1100 - * @tc.name Pass in parameters - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_1100", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_1100-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_1100"; - var cmdmyapp7 = "cp data/test/ConnectStageMyApplication7.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmdmyapp7, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var str7 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility7", - }; - startService(TAG, str7); - setTimeout(function () { - - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_1100-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_Stage_ConnectAbility_Ext_1200 - * @tc.name The atomic service of the target differs only by moduleName - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_ConnectAbility_Ext_1200", 0, async function (done) { - console.log("------------start FreeInstall_Stage_ConnectAbility_Ext_1200-------------"); - TAG = "FreeInstall_Stage_ConnectAbility_Ext_1200"; - var cmdmyapp8 = "cp data/test/ConnectStageMyApplication8.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - globalThis.delegator.executeShellCommand(cmdmyapp8, (err: any, d: any) => { - console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(1000); - var str9 = { - "bundleName": "com.example.myapplication.hmservice", - "abilityName": "com.example.myapplication.ServiceAbility9", - }; - startService(TAG, str9); - setTimeout(function () { - console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); - expect(dataAssert).assertEqual("onConnect"); - console.log("------------end FreeInstall_Stage_ConnectAbility_Ext_1200-------------"); - done(); - }, 4000); - }); - } - ) -} - diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ListTest.ets deleted file mode 100644 index 16cdee817a3fb77325df1eeb9de4fe28babac76a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ListTest.ets +++ /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 ConnectAbilityTest from './ConnectAbilityTest' -import ConnectAbilityTest_Ext from './ConnectAbilityTest_Ext' - -export default function List(context) { - ConnectAbilityTest(context) - ConnectAbilityTest_Ext(context) - -} - diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json deleted file mode 100644 index d853356e6f046303eadac4e0362674b733d7f42c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.myapplication.hmservice.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - }, - { - "name": "com.example.myapplication.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:MainAbility2_label" - } - ], - "extensionAbilities": [ - { - "name": "com.example.myapplication.ServiceAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility2", - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "label": "$string:form_ServiceAbility2_label", - "description": "$string:form_ServiceAbility2_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility3", - "srcEntrance": "./ets/ServiceAbility3/ServiceAbility3.ts", - "label": "$string:form_ServiceAbility3_label", - "description": "$string:form_ServiceAbility3_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility4", - "srcEntrance": "./ets/ServiceAbility4/ServiceAbility4.ts", - "label": "$string:form_ServiceAbility4_label", - "description": "$string:form_ServiceAbility4_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility5", - "srcEntrance": "./ets/ServiceAbility5/ServiceAbility5.ts", - "label": "$string:form_ServiceAbility5_label", - "description": "$string:form_ServiceAbility5_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility6", - "srcEntrance": "./ets/ServiceAbility6/ServiceAbility6.ts", - "label": "$string:form_ServiceAbility6_label", - "description": "$string:form_ServiceAbility6_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility7", - "srcEntrance": "./ets/ServiceAbility7/ServiceAbility7.ts", - "label": "$string:form_ServiceAbility7_label", - "description": "$string:form_ServiceAbility7_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility8", - "srcEntrance": "./ets/ServiceAbility8/ServiceAbility8.ts", - "label": "$string:form_ServiceAbility8_label", - "description": "$string:form_ServiceAbility8_desc", - "type": "service" - }, - { - "name": "com.example.myapplication.ServiceAbility9", - "srcEntrance": "./ets/ServiceAbility9/ServiceAbility9.ts", - "label": "$string:form_ServiceAbility9_label", - "description": "$string:form_ServiceAbility9_desc", - "type": "service" - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name":"ohos.permission.START_INVISIBLE_ABILITY" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 4f0ccddf1080aa6c827371305a49b0fb69d1461b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "MainAbility2_desc", - "value": "description" - }, - { - "name": "MainAbility2_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility2_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility2_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility3_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility3_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility4_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility4_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility5_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility5_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility6_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility6_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility7_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility7_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility8_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility8_label", - "value": "form_label" - }, - { - "name": "form_ServiceAbility9_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility9_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index cf165f79684f747143d39db9288641c423b2e0fe..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index", - "pages/index2" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/BUILD.gn deleted file mode 100644 index 72cd413f66afc0f2aaae9aa143b9fc56de9680a6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication0") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication0_js_assets", - ":connectstagemyapplication0_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication0" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication0_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication0_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication0_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication0_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 03faaa0be0e9f07a4357a13d3364a532097aaff5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp0 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp0 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp0 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp0 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp0 onConnect'); - console.info('ConnectAbilityTest connect myapp0 Servcie success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp0 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp0 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp0 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 0f3fc266d0d500984fabc686d7cfc2e8822ba92a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp0' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/module.json deleted file mode 100644 index b5dd8f0af8a195362ac279a045d4dc84b4d298db..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/element/string.json deleted file mode 100644 index b33227ebf7d960033fcbb36fb2ed5561de481164..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/BUILD.gn deleted file mode 100644 index f2cde202a93fca566f8d8b2956d5dfceee2c76cf..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication1") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication1_js_assets", - ":connectstagemyapplication1_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication1" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication1_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication1_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication1_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication1_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/ServiceAbility_feature/ServiceAbility_feature.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/ServiceAbility_feature/ServiceAbility_feature.ts deleted file mode 100644 index 804f965bb178e90e85fa8eadd68e882908605756..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/ServiceAbility_feature/ServiceAbility_feature.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility feature onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility feature op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility_feature extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility feature onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility feature onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility feature onConnect'); - console.info('ConnectAbilityTest connect myapp1 Servcie_feature success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility feature onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility feature onReconnect'); - } - onDestroy() { - console.info('ServiceAbility feature onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/pages/index.ets deleted file mode 100644 index ada8c9177f629fdda43e5a1ecff2acb9fa0fd937..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp1' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/module.json deleted file mode 100644 index 7bc35e32ab815268224f75190f70bc80d9d3733f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication1", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication1_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility_myapp1", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility_feature", - "srcEntrance": "./ets/ServiceAbility_feature/ServiceAbility_feature.ts", - "label": "$string:form_ServiceAbility_feature_label", - "description": "$string:form_ServiceAbility_feature_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 97597539570eca059b2b9a931819fe61437cd016..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication1_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_feature_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_feature_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/BUILD.gn deleted file mode 100644 index a69911871ed790819182b4f88bd18b37eb9f9fec..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication2") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication2_js_assets", - ":connectstagemyapplication2_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication2" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication2_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication2_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication2_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication2_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 79a75050009d998d6c754fed6fa2a5ce711111b4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/MainAbility/MainAbility.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.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.myapp2 = this.context; - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - setTimeout(function () { - globalThis.myapp2.terminateSelf() - .then((data) => { - console.info('[Demo] myapp2 terminateself succeeded: ' + data); - }).catch((error) => { - console.error('[Demo] myapp2 terminateself failed. Cause: ' + error); - }) - }, 3200); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 9e3d97fad30acc9573ed2c835f26077eae143ee7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp2 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp2 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp2 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp2 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp2 onConnect'); - console.info('ConnectAbilityTest connect myapp2 Servcie success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp2 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp2 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp2 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 7f010fbe82e4c98fd7421e8110c04033ecf59a42..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp2' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/module.json deleted file mode 100644 index af8a46b64fd30bb15ca6f21adaec970d06e72187..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication2", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication2_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility_myapp2", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility2", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/element/string.json deleted file mode 100644 index ef79324a9998468c22bffa131ae3535040aa69ad..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication2_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/BUILD.gn deleted file mode 100644 index 28daf92077a903a36570abaeccd8154d1d2b36a9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication3") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication3_js_assets", - ":connectstagemyapplication3_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication3" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication3_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication3_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication3_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication3_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/ServiceAbility_feature/ServiceAbility_feature.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/ServiceAbility_feature/ServiceAbility_feature.ts deleted file mode 100644 index ae629c302eb88065ab6fb186f6330a5b789c5687..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/ServiceAbility_feature/ServiceAbility_feature.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp3 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp3 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility_feature extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp3 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp3 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp3 onConnect'); - console.info('ConnectAbilityTest connect myapp3 Servcie_feature success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp3 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp3 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp3 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/pages/index.ets deleted file mode 100644 index affea271289c1e604493acf05b05a3578ba16ba3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp3' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/module.json deleted file mode 100644 index 77b01e1caafa8e0be2e38f4d1c43040aa7c5d14b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication3", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication3_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility_myapp3", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility_feature", - "srcEntrance": "./ets/ServiceAbility_feature/ServiceAbility_feature.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d3dc82fd39ec0a1a61621302fdfccb6bb9b51e75..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication3_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/BUILD.gn deleted file mode 100644 index ccef623e49116b4d45a5a7cf17a3c07b346026a9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication4") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication4_js_assets", - ":connectstagemyapplication4_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication4" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication4_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication4_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication4_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication4_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 787b0869e45e9fba46f2a964f9ac61c70ed23d62..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp4 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp4 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp4 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp4 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp4 onConnect'); - console.info('ConnectAbilityTest connect myapp4 Servcie success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp4 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp4 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp4 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/pages/index.ets deleted file mode 100644 index bb6a4119b8674ac5f03e0a811e7c3e03640e80fe..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp4' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/module.json deleted file mode 100644 index e1ea42011c1545d8e903f920950624cbe1fd7c22..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication4", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication4_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility_myapp4", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility4", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 08442ec182efddaf4dbba000d78271085e5ee942..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication4_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/BUILD.gn deleted file mode 100644 index da86272cdc7cd33ad6333b095179167294605f1b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication5") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication5_js_assets", - ":connectstagemyapplication5_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication5" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication5_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication5_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication5_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication5_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/SeriveAbility/SeriveAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/SeriveAbility/SeriveAbility.ts deleted file mode 100644 index 8fe54f2b712daa563f4c0141fb5dcc89ace1a868..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/SeriveAbility/SeriveAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp5 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp5 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp5 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp5 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp5 onConnect'); - console.info('ConnectAbilityTest connect myapp5 Servcie success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp5 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp5 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp5 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/pages/index.ets deleted file mode 100644 index cda4beb8e07e4768923f0f9ca8832bdf9d6b0338..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp5' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/module.json deleted file mode 100644 index ff364d6601054b4c6b8a76523e165bb27323ac62..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication5", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication5_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility_myapp5", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility5", - "srcEntrance": "./ets/SeriveAbility/SeriveAbility.ts", - "label": "$string:form_SeriveAbility_label", - "description": "$string:form_SeriveAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 26e5740a2d895c067ddca1b889c4471b8419d6c8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication5_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_SeriveAbility_desc", - "value": "form_description" - }, - { - "name": "form_SeriveAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/BUILD.gn deleted file mode 100644 index 9cc54a461b1dc3f561ebf0e61a02512b9d5c4a82..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication6") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication6_js_assets", - ":connectstagemyapplication6_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication6" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication6_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication6_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication6_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication6_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 32f6e5e8ca1c2cae575fc00db5cf0cb74947aa4b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp6 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp6 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp6 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp6 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp6 onConnect'); - console.info('ConnectAbilityTest connect myapp6 Servcie success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp6 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp6 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp6 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 230696d7e9ce3d410649ffc8d5e2bffd2f25471a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp6' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/module.json deleted file mode 100644 index c1efed96ef05d9afb5225dc5a67cedded6c693dd..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication6", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication6_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility6", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 556e81fbb5c56f79f8c04170249cf857660a2e0e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication6_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/BUILD.gn deleted file mode 100644 index 6ac195b0455eec8f389b040c8c8aa5c906c51d2d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication7") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication7_js_assets", - ":connectstagemyapplication7_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication7" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication7_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication7_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication7_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication7_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 48849a513a8971d5cfc50e9fe14bfacc5ae80e89..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp7 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp7 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp7 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp7 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp7 onConnect'); - console.info('ConnectAbilityTest connect myapp7 Servcie success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp7 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp7 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp7 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 475e1004167ccb883a98052cdc174902e10d5079..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp7' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/module.json deleted file mode 100644 index a06383e72751494cda58cb55fed4f074b75b6a53..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication7", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication7_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility7", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f35b2f3d5816994467ee4ee93f41d4c2acea9a1a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication7_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/app.json deleted file mode 100644 index 4d49fd0bb6d44d08b824f1f1e2abeac84bec9758..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication.hmservice", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/resources/base/element/string.json deleted file mode 100644 index ba39c935bd73121b8ca4b4930df3b0634cfdf96c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "connect_XTS" - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/BUILD.gn deleted file mode 100644 index cc87b11f4c30bb0b44c34593a5bb9f4d2f1525d2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ConnectStageMyApplication8") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":connectstagemyapplication8_js_assets", - ":connectstagemyapplication8_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ConnectStageMyApplication8" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("connectstagemyapplication8_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("connectstagemyapplication8_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("connectstagemyapplication8_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":connectstagemyapplication8_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bcdd947686bff32663fc19386dc826e4dad19ceb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 6039469310ec5c9a6ab7e6ddededaf9a857d72d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 9d80376d419c3551dbd1ae8a3edcc29de0306df8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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 rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility myapp8 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility myapp8 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility myapp8 onCreate'); - } - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility myapp8 onRequest'); - } - onConnect(want) { - console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility myapp8 onConnect'); - console.info('ConnectAbilityTest connect myapp8 Servcie success'); - return new StubTest("test"); - } - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp8 onDisconnect'); - } - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility myapp8 onReconnect'); - } - onDestroy() { - console.info('ServiceAbility myapp8 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 76e7f5e858ef0d5f33618356a55980c442756547..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello myapp8' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/module.json deleted file mode 100644 index 6a7f18aff876ed750b07a42bebacb426941072b3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "myapplication8", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:myapplication8_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceAbility6", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 7a6badcda1f185180ee656ed8063d3990e011df5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "myapplication8_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "form_ServiceAbility_desc", - "value": "form_description" - }, - { - "name": "form_ServiceAbility_label", - "value": "form_label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index f492149e4e962612194d319aaddd72344bf38bf1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,491 +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 rpc from '@ohos.rpc' -import bundle from "@ohos.bundle"; -import freeInstall from '@ohos.bundle.freeInstall'; - -var result = { - transactId: "-1", - resultMsg: "", - retCode: 0 // 0表示FA服务端执行成功 -} - -var progress = { - downloadSize: 0, - totalSize: 0 -} - -// FA服务中心需要传递给BMS的json字符串的原始对象 -var installResult = { - version: "1", - result: result, - progress: progress -} - -var targetbundleName = ""; -var targetabilityName = ""; -var targetmoduleName = ""; -var path = ["/data/storage/el2/base/haps/entry/files/"]; -var exterrcode = 0; -var sendcode; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des); - } - - onRemoteRequest(code: any, data: any, reply: any, option: any) { - console.info('ServiceAbility serviceCenter onRemoteRequest START'); - //获取BMS传递的Token - let interfaceToken = data.readInterfaceToken(); - console.info("ServiceAbility serviceCenter sendRequest interfaceToken = " + interfaceToken); - // 获取BMS传递的参数 -- json字符串 - let op1 = data.readString(); - console.info("ServiceAbility serviceCenter sendRequest op1 = " + op1); - let targetAbilityInfo = JSON.parse(op1); - // 解析出BMS传递的transactId - let transactId = targetAbilityInfo.targetInfo.transactId; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->transactId = " - + transactId); - // 解析出BMS传递的bundleName - targetbundleName = targetAbilityInfo.targetInfo.bundleName; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->bundleName = " - + targetbundleName); - // 解析出BMS传递的abilityName - targetabilityName = targetAbilityInfo.targetInfo.abilityName; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->abilityName = " - + targetabilityName); - // 解析出BMS传递的moduleName - targetmoduleName = targetAbilityInfo.targetInfo.moduleName; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->moduleName = " - + targetmoduleName); - - // 解析出BMS传递的扩展信息的错误码 - let targeterrcode = targetAbilityInfo.targetExtSetting.extInfo.Servicecenter_error_code; - console.info("ServiceAbility serviceCenter targetAbilityInfo->targetExtSetting->extInfo->" + - "Servicecenter_error_code = " + targeterrcode); - if (targeterrcode === undefined) { - exterrcode = 0; - console.info("ServiceAbility serviceCenter exterrcode = " + exterrcode); - } else { - exterrcode = parseInt(targeterrcode); - console.info("ServiceAbility serviceCenter exterrcode = " + exterrcode); - } - - // 获取BSM传递的callback对象 - let op2 = data.readRemoteObject(); - console.info("ServiceAbility serviceCenter sendRequest op2 = " + op2); - - console.info("ServiceAbility serviceCenter sendRequest code = " + code); - - if (code == 2 || code == 4 ) { // 2为免安装 3为检查更新 4为安装 - targetInfoCheck(transactId, op2) - } else if (code == 3) { - serviceCheckUpdate(transactId, op2); - } -// else if (code == 4) { -// updateInfoCheck(transactId, op2); -// } - return true; - } -} - -async function targetInfoCheck(transactId: string, remoteObj: any) { - if (exterrcode != 0) { - console.info("ServiceAbility serviceCenter targetInfoCheck exterrcode = " + exterrcode); - let retcode = exterrcode; - console.info("ServiceAbility serviceCenter targetInfoCheck retcode = " + retcode); - sendCallBack(transactId, remoteObj, retcode); - } - else if ( (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication6.ServiceAbility" && targetmoduleName === "myapplication6" - )) { - path = ["/data/storage/el2/base/haps/entry/files/ConnectFaMyApplication6.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication1.ServiceAbility_feature" && targetmoduleName === "myapplication1" - ) - || (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication1.MainAbility" && targetmoduleName === "myapplication1" - )) { - path = ["/data/storage/el2/base/haps/entry/files/ConnectFaMyApplication1.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication1.ServiceAbility_feature" && targetmoduleName === "myapplication3" - ) { - path = ["/data/storage/el2/base/haps/entry/files/ConnectFaMyApplication3.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication5.ServiceAbility5" && targetmoduleName === "myapplication5" - ) { - path = ["/data/storage/el2/base/haps/entry/files/ConnectFaMyApplication5.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication7.ServiceAbility" && targetmoduleName === "myapplication7" - ) { - path = ["/data/storage/el2/base/haps/entry/files/ConnectFaMyApplication7.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication8.ServiceAbility" && targetmoduleName === "myapplication8" - ) { - path = ["/data/storage/el2/base/haps/entry/files/ConnectFaMyApplication8.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication7.ServiceAbility" && targetmoduleName === "myapplication9" - ) { - path = ["/data/storage/el2/base/haps/entry/files/ConnectFaMyApplication9.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - //connect stage - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "ServiceAbility" && targetmoduleName === "myapplication" - ){ - path = ["/data/storage/el2/base/haps/entry/files/ConnectStageMyApplication0.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "ServiceAbility_feature" && targetmoduleName === "myapplication1" - ){ - path = ["/data/storage/el2/base/haps/entry/files/ConnectStageMyApplication1.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "ServiceAbility_feature" && targetmoduleName === "myapplication3" - ){ - path = ["/data/storage/el2/base/haps/entry/files/ConnectStageMyApplication3.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "ServiceAbility5" && targetmoduleName === "myapplication5" - ){ - path = ["/data/storage/el2/base/haps/entry/files/ConnectStageMyApplication5.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "ServiceAbility6" && targetmoduleName === "myapplication6" - ){ - path = ["/data/storage/el2/base/haps/entry/files/ConnectStageMyApplication6.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "ServiceAbility7" && targetmoduleName === "myapplication7" - ){ - path = ["/data/storage/el2/base/haps/entry/files/ConnectStageMyApplication7.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "ServiceAbility6" && targetmoduleName === "myapplication8" - ) ){ - path = ["/data/storage/el2/base/haps/entry/files/ConnectStageMyApplication8.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_stage.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "com.ohos.atomic1.MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_FA.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.startAbilityForResult.hmservice" && - targetabilityName === "MainAbility1" && targetmoduleName === "myapplication1" - ) { - path = ["/data/storage/el2/base/haps/entry/files/StageResultMyApplication1.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.open.harmony.startAbilityForResult" && - targetabilityName === "com.example.myapplication1.MainAbility1" && targetmoduleName === "myapplication1" - ) { - path = ["/data/storage/el2/base/haps/entry/files/FaResultMyApplication1.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } else if (targetbundleName === "com.open.harmony.startAbility" && - targetabilityName === "com.example.myapplication1.MainAbility1" && targetmoduleName === "myapplication1" - ) { - path = ["/data/storage/el2/base/haps/entry/files/FaMyApplication1.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.ServiceAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.MainAbility" && targetmoduleName === "hm1" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.hm3.MainAbility" && targetmoduleName === "hm3" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.hm2.MainAbility" && targetmoduleName === "hnm2" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "hm3MainAbility" && targetmoduleName === "hm3" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "hnm2MainAbility" && targetmoduleName === "hnm2" - ) - || (targetbundleName === "com.example.myapplication.hmservice0" && - targetabilityName === "com.example.myapplication.MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.myapplication.hmservice0" && - targetabilityName === "com.example.myapplication1.MainAbility" && targetmoduleName === "myapplication1" - ) - || (targetbundleName === "com.example.myapplication.hmservice0" && - targetabilityName === "com.example.myapplication2.MainAbility" && targetmoduleName === "myapplication2" - ) - || (targetbundleName === "com.open.harmony.myapplication0.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.open.harmony.myapplication0.hmservice" && - targetabilityName === "MainAbility1" && targetmoduleName === "myapplication1" - ) - || (targetbundleName === "com.open.harmony.myapplication0.hmservice" && - targetabilityName === "MainAbility2" && targetmoduleName === "myapplication2" - ) - || (targetbundleName === "com.open.harmony.packagemag.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "myapplication1" - ) - ) { - path = ["/data/storage/el2/base/haps/entry/files"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.hm2.MainAbility" && targetmoduleName === "hm4" - ) { - path = ["/data/storage/el2/base/haps/entry/files/AtomizationFaHm4.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplicationA.hmserviceA" && - targetabilityName === "com.example.myapplicationA.MainAbility" && targetmoduleName === "entry" - ) || (targetbundleName === "com.open.harmony.myapplicationA.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry")) { - path = ["/data/storage/el2/base/haps/entry/files/AtomizationResultA.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplicationB.hmserviceB" && - targetabilityName === "com.example.myapplicationB.MainAbility" && targetmoduleName === "entry" - ) || (targetbundleName === "com.open.harmony.myapplicationB.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry")) { - path = ["/data/storage/el2/base/haps/entry/files/B.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplicationC.hmserviceC" && - targetabilityName === "com.example.myapplicationC.MainAbility" && targetmoduleName === "entry" - ) || (targetbundleName === "com.open.harmony.myapplicationC.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry")) { - path = ["/data/storage/el2/base/haps/entry/files/C.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else { - sendCallBack(transactId, remoteObj, -1); - } -} - -async function updateInfoCheck(transactId: string, remoteObj: any) { - //startAbility 高低版本 - if (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.MainAbility" && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/sign-core-qianyi-allv2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - //免安装更新 stage模型 - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_stage_V2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - //免安装更新 FA模型 - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "com.ohos.atomic1.MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_FA_V2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - //免安装更新 同应用 Stage模型 - else if (targetbundleName === "com.ohos.myapplication.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "myapplication" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapp_stage_V2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - - else { - sendCallBack(transactId, remoteObj, -1); - } -} - -async function serviceInstall(transactId: string, remoteObj: any) { - console.info('ServiceAbility serviceCenter install start'); - // let bundleFilePaths = ["/data/storage/el2/base/haps/entry/files/"]; - let bundleFilePaths = path; - let param = { - userId: 100, - installFlag: 16, - isKeepData: false - } - let installer = await bundle.getBundleInstaller(); - installer.install(bundleFilePaths, param, (err: any, data: any) => { - console.info('ServiceAbility serviceCenter install. Data status: ' + JSON.stringify(data.status)); - console.info('ServiceAbility serviceCenter install. Data statusMessage: ' + JSON.stringify(data.statusMessage)); - console.info('ServiceAbility serviceCenter install. bundleFilePaths:' + JSON.stringify(bundleFilePaths)); - console.info('ServiceAbility serviceCenter install. param:' + JSON.stringify(param)); - console.info('ServiceAbility serviceCenter install. Cause:' + JSON.stringify(err)); - sendcode = parseInt(err.code); - if (sendcode === -1) { - sendcode = -5; - } - console.info('ServiceAbility serviceCenter install. code:' + sendcode); - freeInstall.setHapModuleUpgradeFlag(targetbundleName, targetmoduleName, 0) - .then((data) => { - console.info('ServiceAbility serviceCenter install flag bundleName : ' + JSON.stringify(targetbundleName) - + ', moduleName : ' + JSON.stringify(targetmoduleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag method, data: ' + JSON.stringify(data)); - }).catch((error) => { - console.info('ServiceAbility serviceCenter install flag bundleName : ' + JSON.stringify(targetbundleName) - + ', moduleName : ' + JSON.stringify(targetmoduleName)); - console.error('ServiceAbility serviceCenter UpgradeFlag method, error: ' + JSON.stringify(error)); - }); - console.info("ServiceAbility serviceCenter serviceInstall callBack obj = " + remoteObj); - console.info("ServiceAbility serviceCenter serviceInstall code = " + sendcode); - sendCallBack(transactId, remoteObj, sendcode); - }); - -} - -async function serviceCheckUpdate(transactId: string, remoteObj: any) { - console.info('ServiceAbility serviceCenter serviceCheckUpdate start'); - freeInstall.setHapModuleUpgradeFlag(targetbundleName, targetmoduleName, 1) - .then((data) => { - console.info('ServiceAbility serviceCenter UpgradeFlag bundleName value: ' + JSON.stringify(targetbundleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag moduleName value: ' + JSON.stringify(targetmoduleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag method, data: ' + JSON.stringify(data)); - }).catch((error) => { - console.info('ServiceAbility serviceCenter UpgradeFlag bundleName value: ' + JSON.stringify(targetbundleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag moduleName value: ' + JSON.stringify(targetmoduleName)); - console.error('ServiceAbility serviceCenter UpgradeFlag method, error: ' + JSON.stringify(error)); - }); - setTimeout(function () { - console.info("ServiceAbility serviceCenter serviceCheckUpdate sendCallBack sleep 35000 !!!") - sendCallBack(transactId, remoteObj, 0); - },35000) -} - -function sendCallBack(transactId: string, remoteObj: any, code: number) { - console.info("ServiceAbility serviceCenter sendCallBack remoteObj = " + remoteObj); - let option1 = new rpc.MessageOption(); - let data1 = rpc.MessageParcel.create(); - let reply1 = rpc.MessageParcel.create(); - // 写入token - // data1.writeInterfaceToken("ohos.aafwk.IAtomicServiceStatusCallback"); - data1.writeInterfaceToken("abilitydispatcherhm.openapi.hapinstall.IHapInstallCallback"); - // 将BMS传递的transactId返回给BMS - installResult.result.transactId = transactId; - installResult.result.retCode = code; - console.info('ServiceAbility serviceCenter code:' + code); - let returnString = JSON.stringify(installResult); - console.info("ServiceAbility serviceCenter sendRequest returnString = " + returnString); - // 返回给BMS的参数 -- json字符串 - data1.writeString(returnString); - remoteObj.sendRequest(1, data1, reply1, option1, (err, result) => { - console.info("ServiceAbility serviceCenter sendRequest result:" + result + ",err:" + err); - if (err === 0) { - console.info("ServiceAbility serviceCenter sendRequest got result"); - } - }); -} - - - -export default class ServiceExtAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility serviceCenter onRequest'); - } - - onConnect(want) { - // console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onConnect'); - return new StubTest("test"); - } - - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onDisconnect'); - } - - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onReconnect'); - } - - onDestroy() { - console.info('ServiceAbility serviceCenter onDestroy'); - } -} diff --git a/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json index 2c3544677fafcf54308e3b85bae004a2d7302080..1c6a22e79e2a4d13f97d3c30e9201dea411867e0 100644 --- a/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:entry_desc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "requestPermissions": [ {"name": "ohos.permission.INSTALL_BUNDLE"}], "deliveryWithInstall": true, @@ -33,17 +33,6 @@ } ] } - ], - "extensionAbilities": [ - { - "name": "HapInstallServiceAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service", - "visible": true, - "icon": "$media:icon" - } ] } } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/mockservice/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/mockservice/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..8cecd1ecf5a6df8d67d05d86b7bc9dd39fb780b2 100755 Binary files a/ability/ability_runtime/freeinstalltest/mockservice/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/mockservice/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 4642388dea26431cd82688c82bc3a26d40ae3ca0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,451 +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 rpc from '@ohos.rpc' -import bundle from "@ohos.bundle"; -import freeInstall from '@ohos.bundle.freeInstall'; - -var result = { - transactId: "-1", - resultMsg: "", - retCode: 0 // 0表示FA服务端执行成功 -} - -var progress = { - downloadSize: 0, - totalSize: 0 -} - -// FA服务中心需要传递给BMS的json字符串的原始对象 -var installResult = { - version: "1", - result: result, - progress: progress -} - -var targetbundleName = ""; -var targetabilityName = ""; -var targetmoduleName = ""; -var path = ["/data/storage/el2/base/haps/entry/files/"]; -var exterrcode = 0; -var sendcode; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des); - } - - onRemoteRequest(code: any, data: any, reply: any, option: any) { - console.info('ServiceAbility serviceCenter onRemoteRequest START'); - //获取BMS传递的Token - let interfaceToken = data.readInterfaceToken(); - console.info("ServiceAbility serviceCenter sendRequest interfaceToken = " + interfaceToken); - // 获取BMS传递的参数 -- json字符串 - let op1 = data.readString(); - console.info("ServiceAbility serviceCenter sendRequest op1 = " + op1); - let targetAbilityInfo = JSON.parse(op1); - // 解析出BMS传递的transactId - let transactId = targetAbilityInfo.targetInfo.transactId; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->transactId = " - + transactId); - // 解析出BMS传递的bundleName - targetbundleName = targetAbilityInfo.targetInfo.bundleName; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->bundleName = " - + targetbundleName); - // 解析出BMS传递的abilityName - targetabilityName = targetAbilityInfo.targetInfo.abilityName; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->abilityName = " - + targetabilityName); - // 解析出BMS传递的moduleName - targetmoduleName = targetAbilityInfo.targetInfo.moduleName; - console.info("ServiceAbility serviceCenter sendRequest targetAbilityInfo->targetInfo->moduleName = " - + targetmoduleName); - - // 解析出BMS传递的扩展信息的错误码 - let targeterrcode = targetAbilityInfo.targetExtSetting.extInfo.Servicecenter_error_code; - console.info("ServiceAbility serviceCenter targetAbilityInfo->targetExtSetting->extInfo->" + - "Servicecenter_error_code = " + targeterrcode); - if (targeterrcode === undefined) { - exterrcode = 0; - console.info("ServiceAbility serviceCenter exterrcode = " + exterrcode); - } else { - exterrcode = parseInt(targeterrcode); - console.info("ServiceAbility serviceCenter exterrcode = " + exterrcode); - } - - // 获取BSM传递的callback对象 - let op2 = data.readRemoteObject(); - console.info("ServiceAbility serviceCenter sendRequest op2 = " + op2); - - console.info("ServiceAbility serviceCenter sendRequest code = " + code); - - if (code == 2 || code == 4 ) { // 2为免安装 3为检查更新 4为安装 -// targetInfoCheck(transactId, op2) - } else if (code == 3) { -// serviceCheckUpdate(transactId, op2); - } -// else if (code == 4) { -// updateInfoCheck(transactId, op2); -// } - return true; - } -} - -async function targetInfoCheck(transactId: string, remoteObj: any) { - if (exterrcode != 0) { - console.info("ServiceAbility serviceCenter targetInfoCheck exterrcode = " + exterrcode); - let retcode = exterrcode; - console.info("ServiceAbility serviceCenter targetInfoCheck retcode = " + retcode); - sendCallBack(transactId, remoteObj, retcode); - } - else if ((targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication.ServiceAbility" && targetmoduleName === "myapplication" - ) || (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication6.ServiceAbility" && targetmoduleName === "myapplication6" - )) { - path = ["/data/storage/el2/base/haps/entry/files/myapp0.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication1.ServiceAbility_feature" && targetmoduleName === "myapplication1" - ) - || (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication1.MainAbility" && targetmoduleName === "myapplication1" - )) { - path = ["/data/storage/el2/base/haps/entry/files/myapp1.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication1.ServiceAbility_feature" && targetmoduleName === "myapplication3" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapp3.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication5.ServiceAbility5" && targetmoduleName === "myapplication5" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapp5.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication6.ServiceAbility6" && targetmoduleName === "myapplication6" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapp6.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication7.ServiceAbility" && targetmoduleName === "myapplication7" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapp7.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } else if ((targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication6.ServiceAbility6" && targetmoduleName === "myapplication8" - ) || (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication8.ServiceAbility" && targetmoduleName === "myapplication8" - )) { - path = ["/data/storage/el2/base/haps/entry/files/myapp8.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } else if (targetbundleName === "com.example.myapplication.hmservice" && - targetabilityName === "com.example.myapplication7.ServiceAbility" && targetmoduleName === "myapplication9" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapp9.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_stage.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "com.ohos.atomic1.MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_FA.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.startAbilityForResult.hmservice" && - targetabilityName === "MainAbility1" && targetmoduleName === "myapplication1" - ) { - path = ["/data/storage/el2/base/haps/entry/files/yuanzihua-myapplication1.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.open.harmony.startAbilityForResult" && - targetabilityName === "com.example.myapplication1.MainAbility1" && targetmoduleName === "myapplication1" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapplication1-FA-2900.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } else if (targetbundleName === "com.open.harmony.startAbility" && - targetabilityName === "com.example.myapplication1.MainAbility1" && targetmoduleName === "myapplication1" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapplication1-FA-s2800.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.ServiceAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.MainAbility" && targetmoduleName === "hm1" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.hm3.MainAbility" && targetmoduleName === "hm3" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.hm2.MainAbility" && targetmoduleName === "hnm2" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "hm3MainAbility" && targetmoduleName === "hm3" - ) - || (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "hnm2MainAbility" && targetmoduleName === "hnm2" - ) - || (targetbundleName === "com.example.myapplication.hmservice0" && - targetabilityName === "com.example.myapplication.MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.example.myapplication.hmservice0" && - targetabilityName === "com.example.myapplication1.MainAbility" && targetmoduleName === "myapplication1" - ) - || (targetbundleName === "com.example.myapplication.hmservice0" && - targetabilityName === "com.example.myapplication2.MainAbility" && targetmoduleName === "myapplication2" - ) - || (targetbundleName === "com.open.harmony.myapplication0.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry" - ) - || (targetbundleName === "com.open.harmony.myapplication0.hmservice" && - targetabilityName === "MainAbility1" && targetmoduleName === "myapplication1" - ) - || (targetbundleName === "com.open.harmony.myapplication0.hmservice" && - targetabilityName === "MainAbility2" && targetmoduleName === "myapplication2" - ) - || (targetbundleName === "com.open.harmony.packagemag.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "myapplication1" - ) - ) { - path = ["/data/storage/el2/base/haps/entry/files"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.hm2.MainAbility" && targetmoduleName === "hm4" - ) { - path = ["/data/storage/el2/base/haps/entry/files/sign-core-hm4-all.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplicationA.hmserviceA" && - targetabilityName === "com.example.myapplicationA.MainAbility" && targetmoduleName === "entry" - ) || (targetbundleName === "com.open.harmony.myapplicationA.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry")) { - path = ["/data/storage/el2/base/haps/entry/files/A.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplicationB.hmserviceB" && - targetabilityName === "com.example.myapplicationB.MainAbility" && targetmoduleName === "entry" - ) || (targetbundleName === "com.open.harmony.myapplicationB.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry")) { - path = ["/data/storage/el2/base/haps/entry/files/B.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else if ((targetbundleName === "com.example.myapplicationC.hmserviceC" && - targetabilityName === "com.example.myapplicationC.MainAbility" && targetmoduleName === "entry" - ) || (targetbundleName === "com.open.harmony.myapplicationC.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "entry")) { - path = ["/data/storage/el2/base/haps/entry/files/C.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - else { - sendCallBack(transactId, remoteObj, -1); - } -} - -async function updateInfoCheck(transactId: string, remoteObj: any) { - //startAbility 高低版本 - if (targetbundleName === "com.example.qianyiyingyong.hmservice" && - targetabilityName === "com.example.qianyiyingyong.MainAbility" && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/sign-core-qianyi-allv2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - //免安装更新 stage模型 - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_stage_V2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - //免安装更新 FA模型 - else if (targetbundleName === "com.ohos.atomic1.hmservice" && - targetabilityName === "com.ohos.atomic1.MainAbility" - // && targetmoduleName === "entry" - ) { - path = ["/data/storage/el2/base/haps/entry/files/Atomic1_FA_V2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - //免安装更新 同应用 Stage模型 - else if (targetbundleName === "com.ohos.myapplication.hmservice" && - targetabilityName === "MainAbility" && targetmoduleName === "myapplication" - ) { - path = ["/data/storage/el2/base/haps/entry/files/myapp_stage_V2.hap"]; - console.info("ServiceAbility serviceCenter targetInfoCheck path: " + JSON.stringify(path)); - serviceInstall(transactId, remoteObj); - } - - else { - sendCallBack(transactId, remoteObj, -1); - } -} - -async function serviceInstall(transactId: string, remoteObj: any) { - console.info('ServiceAbility serviceCenter install start'); - // let bundleFilePaths = ["/data/storage/el2/base/haps/entry/files/"]; - let bundleFilePaths = path; - let param = { - userId: 100, - installFlag: 16, - isKeepData: false - } - let installer = await bundle.getBundleInstaller(); - installer.install(bundleFilePaths, param, (err: any, data: any) => { - console.info('ServiceAbility serviceCenter install. Data status: ' + JSON.stringify(data.status)); - console.info('ServiceAbility serviceCenter install. Data statusMessage: ' + JSON.stringify(data.statusMessage)); - console.info('ServiceAbility serviceCenter install. bundleFilePaths:' + JSON.stringify(bundleFilePaths)); - console.info('ServiceAbility serviceCenter install. param:' + JSON.stringify(param)); - console.info('ServiceAbility serviceCenter install. Cause:' + JSON.stringify(err)); - sendcode = parseInt(err.code); - if (sendcode === -1) { - sendcode = -5; - } - console.info('ServiceAbility serviceCenter install. code:' + sendcode); - freeInstall.setHapModuleUpgradeFlag(targetbundleName, targetmoduleName, 0) - .then((data) => { - console.info('ServiceAbility serviceCenter install flag bundleName : ' + JSON.stringify(targetbundleName) - + ', moduleName : ' + JSON.stringify(targetmoduleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag method, data: ' + JSON.stringify(data)); - }).catch((error) => { - console.info('ServiceAbility serviceCenter install flag bundleName : ' + JSON.stringify(targetbundleName) - + ', moduleName : ' + JSON.stringify(targetmoduleName)); - console.error('ServiceAbility serviceCenter UpgradeFlag method, error: ' + JSON.stringify(error)); - }); - console.info("ServiceAbility serviceCenter serviceInstall callBack obj = " + remoteObj); - console.info("ServiceAbility serviceCenter serviceInstall code = " + sendcode); - sendCallBack(transactId, remoteObj, sendcode); - }); - -} - -async function serviceCheckUpdate(transactId: string, remoteObj: any) { - console.info('ServiceAbility serviceCenter serviceCheckUpdate start'); - freeInstall.setHapModuleUpgradeFlag(targetbundleName, targetmoduleName, 1) - .then((data) => { - console.info('ServiceAbility serviceCenter UpgradeFlag bundleName value: ' + JSON.stringify(targetbundleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag moduleName value: ' + JSON.stringify(targetmoduleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag method, data: ' + JSON.stringify(data)); - }).catch((error) => { - console.info('ServiceAbility serviceCenter UpgradeFlag bundleName value: ' + JSON.stringify(targetbundleName)); - console.info('ServiceAbility serviceCenter UpgradeFlag moduleName value: ' + JSON.stringify(targetmoduleName)); - console.error('ServiceAbility serviceCenter UpgradeFlag method, error: ' + JSON.stringify(error)); - }); - setTimeout(function () { - console.info("ServiceAbility serviceCenter serviceCheckUpdate sendCallBack sleep 35000 !!!") - sendCallBack(transactId, remoteObj, 0); - },35000) -} - -function sendCallBack(transactId: string, remoteObj: any, code: number) { - console.info("ServiceAbility serviceCenter sendCallBack remoteObj = " + remoteObj); - let option1 = new rpc.MessageOption(); - let data1 = rpc.MessageParcel.create(); - let reply1 = rpc.MessageParcel.create(); - // 写入token - // data1.writeInterfaceToken("ohos.aafwk.IAtomicServiceStatusCallback"); - data1.writeInterfaceToken("abilitydispatcherhm.openapi.hapinstall.IHapInstallCallback"); - // 将BMS传递的transactId返回给BMS - installResult.result.transactId = transactId; - installResult.result.retCode = code; - console.info('ServiceAbility serviceCenter code:' + code); - let returnString = JSON.stringify(installResult); - console.info("ServiceAbility serviceCenter sendRequest returnString = " + returnString); - // 返回给BMS的参数 -- json字符串 - data1.writeString(returnString); - remoteObj.sendRequest(1, data1, reply1, option1, (err, result) => { - console.info("ServiceAbility serviceCenter sendRequest result:" + result + ",err:" + err); - if (err === 0) { - console.info("ServiceAbility serviceCenter sendRequest got result"); - } - }); -} - - - -export default class ServiceExtAbility extends ServiceExtensionAbility { - onCreate(want) { - console.info('onCreate, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onCreate'); - } - - onRequest(want, startId) { - console.info('onRequest, want: ' + want.abilityName); - console.info('onRequest, startId: ' + startId); - console.info('ServiceAbility serviceCenter onRequest'); - } - - onConnect(want) { - // console.info('onConnect, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onConnect'); - return new StubTest("test"); - } - - onDisconnect(want) { - console.info('onDisconnect, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onDisconnect'); - } - - onReconnect(want) { - console.info('onReconnect, want:' + want.abilityName); - console.info('ServiceAbility serviceCenter onReconnect'); - } - - onDestroy() { - console.info('ServiceAbility serviceCenter onDestroy'); - } -} diff --git a/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json index 2c3544677fafcf54308e3b85bae004a2d7302080..1c6a22e79e2a4d13f97d3c30e9201dea411867e0 100644 --- a/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:entry_desc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "requestPermissions": [ {"name": "ohos.permission.INSTALL_BUNDLE"}], "deliveryWithInstall": true, @@ -33,17 +33,6 @@ } ] } - ], - "extensionAbilities": [ - { - "name": "HapInstallServiceAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service", - "visible": true, - "icon": "$media:icon" - } ] } } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/mockservicetimeout/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/mockservicetimeout/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..8cecd1ecf5a6df8d67d05d86b7bc9dd39fb780b2 100755 Binary files a/ability/ability_runtime/freeinstalltest/mockservicetimeout/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/mockservicetimeout/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/BUILD.gn deleted file mode 100644 index d0392cdec67ebf7ef3b6abb559777ef6d9df102e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/BUILD.gn +++ /dev/null @@ -1,36 +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("ActsFreeInstallStartAbilityFaTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":actsfreeinstallstartabilityfatest_ets_assets", - ":actsfreeinstallstartabilityfatest_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsFreeInstallStartAbilityFaTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} -ohos_js_assets("actsfreeinstallstartabilityfatest_ets_assets") { - source_dir = "./entry/src/main/ets" - hap_profile = "entry/src/main/config.json" - ets2abc = true -} -ohos_resources("actsfreeinstallstartabilityfatest_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/Test.json deleted file mode 100644 index bc361d1e6227f117f7371775fc144881425fbb50..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/Test.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "description": "Configuration for freeinstallstartabilityfatest Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "600000", - "bundle-name": "com.open.harmony.startAbility", - "package-name": "com.open.harmony.startAbility", - "shell-timeout": "600000", - "testcase-timeout": "50000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFreeInstallStartAbilityFaTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount", - "mkdir /data/test/" - ] - }, - { - "type": "PushKit", - "push":[ - "AtomizationFaEntry.hap -> /data/test/AtomizationFaEntry.hap", - "AtomizationFaHm2.hap -> /data/test/AtomizationFaHm2.hap", - "AtomizationFaHm4.hap -> /data/test/AtomizationFaHm4.hap", - "MockService.hap -> /data/test/MockService.hap", - "MockServiceTimeout.hap -> /data/test/MockServiceTimeout.hap" - ] - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json deleted file mode 100644 index 2a76818c4585245f7983dfa180ee831990387e88..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "app": { - "targetBundleList": [ - "com.example.qianyiyingyong.hmservice" - ], - "vendor": "example", - "bundleName": "com.open.harmony.startAbility", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "mainAbility": ".MainAbility", - "deviceType": [ - "default", - "tablet" - ], - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "formsEnabled": false, - "label": "$string:MainAbility_label", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "PageAbility", - "name": ".PageAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:PageAbility_desc", - "formsEnabled": false, - "label": "$string:PageAbility_label", - "type": "page", - "launchType": "standard" - }, - { - "srcPath": "ServiceAbility", - "name": "com.open.harmony.startAbility.ServiceAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:ServiceAbility_desc", - "type": "service" - } - ], - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "com.open.harmony.startAbility", - "srcPath": "", - "name": ".entry", - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".PageAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "reqPermissions": [ - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "reason": "need use ohos.permission.REMOVE_CACHE_FILES", - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE", - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name":"ohos.permission.START_INVISIBLE_ABILITY", - "reason":"need use ohos.permission.START_INVISIBLE_ABILITY" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index e50dc2a8943d97888deef5b4b36106f52663efc1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/app.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. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 7161ba8b7967b73f7e9dffe85b4b7aefa7c34e2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ /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 router from '@system.router'; -import file from '@system.file'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from "../test/List.test"; -import featureAbility from "@ohos.ability.featureAbility"; - -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info("aboutToAppear start!!!!") - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text(' FA- StartAbility TEST ') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - routePage() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 91ea52129f9332d91f4b842b31abcb2685ad620e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/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 startAbilityTest from "./StartAbility.test"; -import startAbilityTest2 from "./StartAbility.test2"; - -export default function testsuite() { - startAbilityTest(); - startAbilityTest2(); - -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets deleted file mode 100644 index 94a1b7f5e3884bf5a8c9b75d5461d77c4ce1443b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets +++ /dev/null @@ -1,1058 +0,0 @@ - -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"; -import featureAbility from "@ohos.ability.featureAbility"; -import wantConstant from '@ohos.ability.wantConstant'; -import abilityManager from '@ohos.application.abilityManager'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import commonEvent from '@ohos.commonEvent'; - -export default function startAbilityTest() { - - describe('startAbilityTest', function () { - - console.info("-------------FA model--> startAbilityXTS Test start----------------") - - var TAG = ""; - - var delegator = AbilityDelegatorRegistry.getAbilityDelegator(); - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - var subscriber; - var result; - var subscribeInfo = { - events: ["service_event"] - }; - - function SubscribeCallBack(err, data) { - if (err.code) { - console.error("Testevent subscribe failed " + JSON.stringify(err)); - } else { - console.info("Testevent subscribe " + JSON.stringify(data)); - for (var key1 in data.parameters) { - console.info("Testevent data.parameters[key] is :" + data.parameters[key1]) - if (data.parameters[key1] === "onSuccess") { - result = "onSuccess" - } - } - } - } - - function CreateSubscriberCallBack(err, commonEventSubscriber) { - if (err.code) { - console.error("Testevent createSubscriber failed " + JSON.stringify(err)); - } else { - console.info("Testevent createSubscriber"); - subscriber = commonEventSubscriber; - commonEvent.subscribe(subscriber, SubscribeCallBack); - } - } - - beforeAll(async function (done) { - console.info("StartAbilityForResult before all called"); - var cmd = "bm install -p data/test/MockService.hap"; - console.info("cmd : " + cmd) - delegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - delegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd3 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd3, (err: any, d: any) => { - console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - done(); - }) - }); - - afterEach(async function (done) { - console.info("StartAbilityTest after each called"); - if ("FreeInstall_FA_Local_StartAbility_0200" === TAG || - "FreeInstall_FA_Local_StartAbility_0500" === TAG || - "FreeInstall_FA_Local_StartAbility_0700" === TAG || - "FreeInstall_FA_Local_StartAbility_0800" === TAG || - "FreeInstall_FA_Local_StartAbility_1000" === TAG || - "FreeInstall_FA_Local_StartAbility_1200" === TAG || - "FreeInstall_FA_Local_StartAbility_1400" === TAG || - "FreeInstall_FA_Local_StartAbility_1600" === TAG || - "FreeInstall_FA_Local_StartAbility_1800" === TAG || - "FreeInstall_FA_Local_StartAbility_2200" === TAG || - "FreeInstall_FA_Local_StartAbility_3000" === TAG || - "FreeInstall_FA_Local_StartAbility_3400" === TAG || - "FreeInstall_FA_Local_StartAbility_3600" === TAG || - "FreeInstall_FA_Local_StartAbility_3700" === TAG || - "FreeInstall_FA_Local_StartAbility_3800" === TAG) { - var cmd4 = "bm uninstall -n com.example.qianyiyingyong.hmservice"; - delegator.executeShellCommand(cmd4, (err: any, d: any) => { - console.info("executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - } - - if ("FreeInstall_FA_Local_StartAbility_3800" === TAG) { - var cmd5 = "bm uninstall -n com.ohos.hag.famanager"; - delegator.executeShellCommand(cmd5, (err: any, d: any) => { - console.info("executeShellCommand5 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - } - await sleep(500); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0100 - * @tc.name The deviceid passed in is null, so the installation free process is implemented - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0100", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0100-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0100"; - let details; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0100-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0200 - * @tc.name The passed in deviceid is empty, and the installed apps are automatically pulled up - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0200", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0200-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0200"; - let details; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0200-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0300 - * @tc.name The deviceid passed in is empty. There is no need to install or installed HAP package - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0300", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0300-------------"); - TAG = "FreeInstall_Stage_Local_StartAbility_0300"; - var cmd300 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd300, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let wrong; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(1000); - expect(wrong.code).assertEqual(4); - console.info("------------end FreeInstall_FA_Local_StartAbility_0300-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0400 - * @tc.name Do not transfer deviceid to realize installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0400", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0400-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0400"; - var cmd400 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd400, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0400-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0500 - * @tc.name The installed application will be automatically pulled up without transmitting the deviceid - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0500", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0500-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0500"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0500-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0600 - * @tc.name Manually obtain and pass in the deviceid of the device to realize the installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0600", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0600-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0600"; - var deviceId = ""; - await abilityManager.getTopAbility((err, data) => { - console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); - console.log(TAG + 'getTopAbility result deviceId:' + JSON.stringify(data.deviceId)); - deviceId = data.deviceId; - }) - await sleep(1000); - let details; - var str = { - 'want': { - "deviceId": deviceId, - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0600-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0700 - * @tc.name Manually obtain and pass in the deviceid of the device, - and the installed application will be automatically pulled up - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0700", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0700-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0700"; - var deviceId = ""; - await abilityManager.getTopAbility((err, data) => { - console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err)); - console.log(TAG + 'getTopAbility result deviceId:' + JSON.stringify(data.deviceId)); - deviceId = data.deviceId; - }) - await sleep(1000); - let details; - var str = { - 'want': { - "deviceId": deviceId, - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0700-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0800 - * @tc.name Without passing deviceid, pull up the HAP with the same bundlename and different - abilityname as the entry to realize the installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0800", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0800-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0800"; - var cmd800 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd800, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd801 = "cp data/test/AtomizationFaHm2.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd801, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.hm2.MainAbility", - "moduleName": "hnm2", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0800-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_0900 - * @tc.name Do not transfer deviceid, use callback to realize installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_0900", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_0900-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_0900"; - var cmd900 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaHm2.hap"; - delegator.executeShellCommand(cmd900, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd901 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd901, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str, (error, data) => { - console.log(TAG + ": startAbility err: " + JSON.stringify(error) + ",data: " + JSON.stringify(data)); - details = data; - }) - setTimeout(function () { - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_0900-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1000 - * @tc.name Do not transmit deviceid, and use callback to automatically pull up installed applications - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1000", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1000-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1000"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str, (error, data) => { - console.log(TAG + ": startAbility err: " + JSON.stringify(error) + ",data: " + JSON.stringify(data)); - details = data; - }) - setTimeout(function () { - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_1000-------------"); - done(); - }, 4000); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1100 - * @tc.name Flags=1717 of the incoming error. There is a hap package that needs to - be installed free under the specified path - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1100", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1100-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1100"; - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": 1717, - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(wrong.code).assertEqual(1); - console.info("------------end FreeInstall_FA_Local_StartAbility_1100-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1200 - * @tc.name Bad flags=1717 passed in, atomized HAP package installed - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1200", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1200-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1200"; - var cmd1200 = "bm install -p data/test/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd1200, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": 1717, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_1200-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1500 - * @tc.name Flags= '' of the incoming error. There is a hap package that needs to be - installed under the specified path - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1500", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1500-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1500"; - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(wrong.code).assertEqual(1); - console.info("------------end FreeInstall_FA_Local_StartAbility_1500-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1600 - * @tc.name Bad flags= ', atomized HAP package installed - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1600", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1600-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1600"; - var cmd1600 = "bm install -p data/test/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd1600, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_1600-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1700 - * @tc.name No flag is transmitted, and there are HAP packages that need to be installed under - the specified path - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1700", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1700-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1700" - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry" - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(wrong.code).assertEqual(1); - console.info("------------end FreeInstall_FA_Local_StartAbility_1700-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1800 - * @tc.name No flag is transmitted, and the atomized HAP package is installed - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1800", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1800-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1800"; - var cmd1800 = "bm install -p data/test/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd1800, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_1800-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_2100 - * @tc.name The parameters field is passed in the want to realize the installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_2100", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_2100-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_2100"; - let details; - var str = { - 'want': { - 'bundleName': "com.example.qianyiyingyong.hmservice", - 'abilityName': "com.example.qianyiyingyong.MainAbility", - 'moduleName': "entry", - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - 'parameters': { - "name": "1111", - "Ext2": "ExtValue2", - "site": "很开心看到你!" - } - } - }; - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - details = data; - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_2100-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_2200 - * @tc.name The parameters field is passed in the want, and the installed applications - are automatically pulled up - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_2200", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_2200-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_2200"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - "parameters": { - "name": "1111", - "Ext2": "ExtValue2", - "site": "很开心看到你!" - } - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_2200-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3000 - * @tc.name There are hapa and hapb with the same bundlename and abilityname and different modulenames. - Under the specified path, there are hapa with correct input parameters that need not be installed - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3000", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3000-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3000"; - var cmd3000 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd3000, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd3001 = "cp data/test/AtomizationFaHm4.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd3001, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.hm2.MainAbility", - "moduleName": "hm4", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_3000-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3100 - * @tc.name There are hapa and hapb with the same bundlename and abilityname and different modulenames. - Hapb with input parameter error exists in the specified path - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3100", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3100-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3100"; - var cmd3100 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaHm4.hap"; - delegator.executeShellCommand(cmd3100, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd3101 = "cp data/test/AtomizationFaHm2.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd3101, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.hm2.MainAbility", - "moduleName": "hm4", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(wrong.code).assertEqual(4); - console.info("------------end FreeInstall_FA_Local_StartAbility_3100-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3200 - * @tc.name Transfer wrong moduleName - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3200", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3200-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3200"; - var cmd3200 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaHm2.hap"; - delegator.executeShellCommand(cmd3200, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd3201 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd3201, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "hnm", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(wrong.code).assertEqual(1); - console.info("------------end FreeInstall_FA_Local_StartAbility_3200-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3300 - * @tc.name Do not transfer moduleName. There are HAP packages that need not be - installed under the specified path - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3300", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3300-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3300"; - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(wrong.code).assertEqual(1); - console.info("------------end FreeInstall_FA_Local_StartAbility_3300-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3400 - * @tc.name Do not transfer moduleName. Atomized HAP package is installed. Start hap successfully. - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3400", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3400-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3400"; - var cmd3400 = "bm install -p data/test/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd3400, (err: any, d: any) => { - console.info("executeShellCommand3400 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let details; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_3400-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3500 - * @tc.name Transfer abilityStartSetting, so the installation free process is implemented - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3500", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3500-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3500"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_3500-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3600 - * @tc.name Transfer abilityStartSetting, so the installation free process is implemented - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3600", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3600-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3600"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_3600-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3700 - * @tc.name Service to pull up the service of the atomized service to realize the installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3700", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3700-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3700"; - commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack); - var str = { - 'want': { - "bundleName": "com.open.harmony.startAbility", - "abilityName": "com.open.harmony.startAbility.ServiceAbility", - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(result).assertEqual("onSuccess"); - console.info("------------end FreeInstall_FA_Local_StartAbility_3700-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_3800 - * @tc.name Add BACKGROUND flags, free install successfully. - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_3800", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_3800-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_3800"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE|wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbility(str).then((data) => { - details = data; - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(details).assertEqual(0); - console.info("------------end FreeInstall_FA_Local_StartAbility_3800-------------"); - done(); - }); - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets deleted file mode 100644 index e69cef2a3c46b55cc69f9e11346dc127a1b0fa1d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"; -import featureAbility from "@ohos.ability.featureAbility"; -import wantConstant from '@ohos.ability.wantConstant'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import commonEvent from '@ohos.commonEvent'; - -export default function startAbilityTest2() { - - describe('startAbilityTest2', function () { - - var TAG = ""; - - var delegator = AbilityDelegatorRegistry.getAbilityDelegator(); - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - beforeAll(async function (done) { - console.info("StartAbilityForResult before all called"); - var cmd = "bm install -p data/test/MockService.hap"; - console.info("cmd : " + cmd) - delegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - delegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd3 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd3, (err: any, d: any) => { - console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - done(); - }) - }); - - afterEach(async function (done) { - console.info("StartAbilityTest after each called"); - if ("FreeInstall_FA_Local_StartAbility_2000" === TAG) { - var cmd4 = "bm uninstall -n com.example.qianyiyingyong.hmservice"; - delegator.executeShellCommand(cmd4, (err: any, d: any) => { - console.info("executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - } - - if ("FreeInstall_FA_Local_StartAbility_2500" === TAG) { - var cmd5 = "bm uninstall -n com.ohos.hag.famanager"; - delegator.executeShellCommand(cmd5, (err: any, d: any) => { - console.info("executeShellCommand5 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - } - await sleep(500); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1900 - * @tc.name The current service is not in the foreground. Page a jumps to page B first. - There are HAP packages that need not be installed under the specified path - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1900", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1900-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1900"; - let wrong; - var str1 = { - 'want': { - "bundleName": "com.open.harmony.startAbility", - "abilityName": "com.open.harmony.startAbility.PageAbility", - "moduleName": "entry", - } - } - featureAbility.startAbility(str1) - .then((data) => { - console.info(TAG + ' StartAbility successful. Promise Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error)); - }) - setTimeout(async () => { - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - expect(wrong.code).assertEqual(13); - }, 2000) - console.info("------------end FreeInstall_FA_Local_StartAbility_1900-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_2000 - * @tc.name The current service is not in the foreground. Page a jumps to page B first. - The atomized HAP package has been installed - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_2000", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_2000-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_2000"; - var cmd2000 = "bm install -p data/test/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd2000, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - let wrong; - var str1 = { - 'want': { - "bundleName": "com.open.harmony.startAbility", - "abilityName": "com.open.harmony.startAbility.PageAbility", - "moduleName": "entry", - } - } - featureAbility.startAbility(str1) - .then((data) => { - console.info(TAG + ' StartAbility successful. Promise Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error)); - }) - setTimeout(async () => { - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND - } - } - await featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(wrong.code).assertEqual(13); - }, 2000) - console.info("------------end FreeInstall_FA_Local_StartAbility_2000-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_2500 - * @tc.name FA Service Center installation free timeout - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_2500", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_2500-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_2500"; - var cmd2500 = "bm uninstall -n com.ohos.hag.famanager"; - delegator.executeShellCommand(cmd2500, (err: any, d: any) => { - console.info("executeShellCommand2500 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd2501 = "bm install -p data/test/MockServiceTimeout.hap"; - delegator.executeShellCommand(cmd2501, (err: any, d: any) => { - console.info("executeShellCommand2501 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd2502 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - delegator.executeShellCommand(cmd2502, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd2503 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd2503, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd2504 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" + - "/entry/files"; - delegator.executeShellCommand(cmd2504, (err: any, d: any) => { - console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - setTimeout(async () => { - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - featureAbility.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - wrong = error; - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(35000); - expect(wrong.code).assertEqual(3); - }, 2000) - console.info("------------end FreeInstall_FA_Local_StartAbility_2500-------------"); - done(); - }); - - console.info("-------------FA model--> startAbilityXTS Test end----------------") - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/Utils.ets deleted file mode 100644 index d1741e6272daeaa9205a8b8a272f6b3cc41a0cc7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/Utils.ets +++ /dev/null @@ -1,131 +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 class Utils { - static rect_left; - static rect_top; - static rect_right; - static rect_bottom; - static rect_value; - - static sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(reject) - }, time) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - static getComponentRect(key) { - let strJson = getInspectorByKey(key); - let obj = JSON.parse(strJson); - console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); - let rectInfo = JSON.parse('[' + obj.$rect + ']') - console.info("[getInspectorByKey] rectInfo is: " + rectInfo); - this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] - this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] - this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] - this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] - return this.rect_value = { - "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom - } - } - - static async swipe(downX, downY, upX, upY, steps) { - console.info('start to swipe') - this.drags(downX, downY, upX, upY, steps, false) - } - - static async drag(downX, downY, upX, upY, steps) { - console.info('start to drag') - this.drags(downX, downY, upX, upY, steps, true) - } - - static async drags(downX, downY, upX, upY, steps, drag) { - var xStep; - var yStep; - var swipeSteps; - var ret; - xStep = 0; - yStep = 0; - ret = false; - swipeSteps = steps; - if (swipeSteps == 0) { - swipeSteps = 1; - } - xStep = (upX - downX) / swipeSteps; - yStep = (upY - downY) / swipeSteps; - console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) - var downPonit: TouchObject = { - id: 1, - x: downX, - y: downY, - type: TouchType.Down, - screenX: 0, - screenY: 1, - } - console.info('down touch started: ' + JSON.stringify(downPonit)) - sendTouchEvent(downPonit); - console.info('start to move') - if (drag) { - await this.sleep(500) - } - for (var i = 1;i <= swipeSteps; i++) { - var movePoint: TouchObject = { - id: 1, - x: downX + (xStep * i), - y: downY + (yStep * i), - type: TouchType.Move, - screenX: 0, - screenY: 1, - } - console.info('move touch started: ' + JSON.stringify(movePoint)) - ret = sendTouchEvent(movePoint) - if (ret == false) { - break; - } - await this.sleep(5) - } - console.info('start to up') - if (drag) { - await this.sleep(100) - } - var upPoint: TouchObject = { - id: 1, - x: upX, - y: upY, - type: TouchType.Up, - screenX: 0, - screenY: 1, - } - console.info('up touch started: ' + JSON.stringify(upPoint)) - sendTouchEvent(upPoint) - await this.sleep(500) - } - - static getNowTime() { - return new Date().getTime(); - } - - static getDurationTime(log,startTime, endTime) { - console.info("Get Interface startTime: " + startTime); - console.info("Get Interface endTime: " + endTime); - var duration = (endTime - startTime); - console.info("Get Interface duration: " + duration); - return duration; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/app.ets deleted file mode 100644 index f7a6eb27919fa676345d20369d39aa6ef9b0b87f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/app.ets +++ /dev/null @@ -1,34 +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 featureAbility from '@ohos.ability.featureAbility'; - -export default { - onCreate() { - console.info('Application onCreate') - setTimeout(function () { - featureAbility.terminateSelf() - .then((data) => { - console.info('PageAbility terminateself succeeded: ' + data); - }).catch((error) => { - console.error('PageAbility terminateself failed. Cause: ' + error); - }) - }, 8000); - }, - - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/pages/index.ets deleted file mode 100644 index 315f8fd0f5e7062165ad23f4983489a34918b816..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/pages/index.ets +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -@Entry -@Component -struct Index { - @State message: string = 'Hello World - PageAbility-B' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index 19d075aee429cfdb5193cb801861ffbf17716543..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/ServiceAbility/service.ts +++ /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 particleAbility from '@ohos.ability.particleAbility'; -import wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - - -var publishOptions = { - parameters: { - "assertData": "onSuccess" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service publish success!!!"); - } -} - -export default { - onStart() { - console.info('PAStartAbilityPromise001 ServiceAbility onStart'); - }, - onStop() { - console.info('PAStartAbilityPromise001 ServiceAbility onStop'); - }, - onCommand(want, startId) { - var str = { - 'want': { - 'deviceId': '', - 'bundleName': 'com.example.qianyiyingyong.hmservice', - 'abilityName': 'com.example.qianyiyingyong.ServiceAbility', - 'moduleName': 'entry', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - }; - console.info('PAStartAbilityPromise001 ServiceAbility startAbility START' + JSON.stringify(str)); - particleAbility.startAbility(str) - .then((data) => { - console.info('FreeInstall_FA_Local_StartAbility_3700 ServiceAbility startAbility successful.' + - ' Data: ' + JSON.stringify(data)) - commonEvent.publish("service_event", publishOptions, PublishCallBack); - }).catch((error) => { - console.info('FreeInstall_FA_Local_StartAbility_3700 ServiceAbility startAbility failed. ' + - 'error: ' + JSON.stringify(error)); - }) - console.info('FreeInstall_FA_Local_StartAbility_3700 ServiceAbility startAbility END'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 06bbc557648940a5153e04c9e584043474ab2a9c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s package','-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - } - - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility' - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e2674d1e6aaaad59b6fc2690508ee39564b4fd06..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "PageAbility_desc", - "value": "description" - }, - { - "name": "PageAbility_label", - "value": "label" - }, - { - "name": "ServiceAbility_desc", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json index b616bf8f9eb3f8bdfdf6bac8b40e69b77a699e6e..0f4264fa51a78d5bf3b967ed023e9916b5f3e0b2 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json @@ -82,35 +82,6 @@ "autoDesignWidth": false } } - ], - "reqPermissions": [ - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "reason": "need use ohos.permission.REMOVE_CACHE_FILES", - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE", - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } ] } } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets index 582a7b57cfdeb3bad751a7df94825b28cb913058..b2f7c90c1f99badee175828cce3b78984ddb8aa4 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets index 2de02227ad3cc4105dc5f0d6b341596b73ea4f17..06e87987a486a82d5ae429e650e32d0829d8d4f1 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets index b1a932cd53e210f6a598c207979dbfa77aa3533d..59a63137a97bfe99d8ea4933c0fba9ce7bcb0765 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +24,7 @@ export default class Utils { static sleep(time) { return new Promise((resolve, reject) => { setTimeout(() => { - resolve(reject) + resolve() }, time) }).then(() => { console.info(`sleep ${time} over...`) @@ -75,8 +76,6 @@ export default class Utils { x: downX, y: downY, type: TouchType.Down, - screenX: 0, - screenY: 1, } console.info('down touch started: ' + JSON.stringify(downPonit)) sendTouchEvent(downPonit); @@ -89,9 +88,7 @@ export default class Utils { id: 1, x: downX + (xStep * i), y: downY + (yStep * i), - type: TouchType.Move, - screenX: 0, - screenY: 1, + type: TouchType.Move } console.info('move touch started: ' + JSON.stringify(movePoint)) ret = sendTouchEvent(movePoint) @@ -109,8 +106,6 @@ export default class Utils { x: upX, y: upY, type: TouchType.Up, - screenX: 0, - screenY: 1, } console.info('up touch started: ' + JSON.stringify(upPoint)) sendTouchEvent(upPoint) @@ -128,4 +123,8 @@ export default class Utils { console.info("Get Interface duration: " + duration); return duration; } -} \ No newline at end of file +} + + + + diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..f9c760f7c565112dd9696c629079401e3652d19e 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json index 088a31c78886ae3d4e1b78088ca7f2eed5f82d06..6b1bcd4ea78b1e60fafe5e92089c339728c25a60 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json @@ -18,8 +18,8 @@ "name": ".MyApplication", "mainAbility": ".MainAbility", "deviceType": [ - "default", - "tablet" + "default", + "tablet" ], "distro": { "deliveryWithInstall": true, @@ -80,17 +80,9 @@ } ], "reqPermissions": [ - { - "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" } ] } diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..b9859b6a54f22bc8e235103538ba76df063ac9ba 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/BUILD.gn deleted file mode 100644 index 10cde53af5283047312862dbfc67caad656ad81d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("AtomizationFaHm2") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":atomizationfahm2_ets_assets", - ":atomizationfahm2_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "AtomizationFaHm2" - subsystem_name = "ability" - part_name = "ability_runtime" -} -ohos_js_assets("atomizationfahm2_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("atomizationfahm2_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/config.json deleted file mode 100644 index 2237d98e44a47151fe114d1bcdb91ed829340d7c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "app": { - "bundleName": "com.example.qianyiyingyong.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.hm2", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "hnm2", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:hnm2_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 5737bf718ac51c5af914d415099513cd0eba292e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility'; -export default { - onCreate() { - console.info('Application onCreate') - setTimeout(function () { - featureAbility.terminateSelf() - .then((data) => { - console.info('hm2 terminateself succeeded: ' + data); - }).catch((error) => { - console.error('hm2 terminateself failed. Cause: ' + error); - }) - }, 1000); - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 21763db69446fc57fad0b2a3c78f51227fd59bfa..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,143 +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'; -import featureAbility from '@ohos.ability.featureAbility' -import wantConstant from '@ohos.ability.wantConstant' -import Prompt from '@system.prompt'; - -const BUNDLE_NAME = 'com.example.qianyiyingyong.hmservice'; -const ABILITY_NAME1 = 'com.example.hm2.MainAbility'; - -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - -@Entry -@Component -struct Index { - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('hm2') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('HNM2 next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - routePage() - }) - - Text('startAbilityPromiseSameBundleName1 本设备,feature覆盖安装') - .height(70) - .width('100%') - .fontSize(20) - .fontColor(Color.White) - .fontWeight(FontWeight.Bold) - .margin({ top: 20 }) - .backgroundColor(Color.Grey) - .onClick(() => { - var str = { - 'want': { - 'bundleName': BUNDLE_NAME, - 'abilityName': ABILITY_NAME1, - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - }; - this.startAbilityPromise('startAbilityPromiseSameBundleName1', str); - - }); - - Button() { - Text('StartAbilityForResult') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - this.terminateSelfWithResult(); - }) - } - .width('100%') - .height('100%') - } - - async aboutToAppear() { - var permissions = ["ohos.permission.DISTRIBUTED_DATASYNC"]; - featureAbility.getContext().requestPermissionsFromUser(permissions, 0, (data) => { - console.info("start requestPermissionsFromUser!!!!") - }) - } - - async terminateSelfWithResult() { - console.info('startAbilityForResultPromise terminateSelfWithResult START'); - await featureAbility.terminateSelfWithResult( - { - resultCode: 1, - want: - { - bundleName: "com.example.qianyiyingyong.hmservice", - abilityName: "com.example.hm2.MainAbility", - }, - } - ); - await featureAbility.terminateSelf(); - console.info('startAbilityForResultPromise terminateSelfWithResult END'); - } - - async startAbilityPromise(tag, str) { - console.info(tag + ' startAbility startAbilityPromise START' + JSON.stringify(str)); - let code; - await featureAbility.startAbility(str) - .then((data) => { - console.info(tag + ' startAbility Operation successful. Promise Data: ' + JSON.stringify(data)) - code = data; - }).catch((error) => { - console.info(tag + ' startAbility Operation failed. Promise Cause: ' + JSON.stringify(error)); - code = error; - }) - console.info(tag + ' startAbility Operation code Promise: ' + JSON.stringify(code)); - if (code === 0) { - this.tips('成功'); - } else { - this.tips('错误码:' + code.code); - } - console.info(tag + ' startAbility startAbilityPromise END'); - } - - tips(msg) { - Prompt.showToast({ - message: msg, - duration: 2000, - bottom: '150px' - }); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/pages/second.ets deleted file mode 100644 index 6e0296ed6e5ec446039002974e449266f2ed14f4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/ets/MainAbility/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 = "HNM2 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/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 8380229de102511d01d094185835cbe3c975d9d8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "hnm2_MainAbility", - "value": "相同BN不同AN" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/BUILD.gn deleted file mode 100644 index 830609a4c47a912c54e9e044c05a03e869e5d82a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("AtomizationFaHm4") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":atomizationfahm4_ets_assets", - ":atomizationfahm4_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "AtomizationFaHm4" - subsystem_name = "ability" - part_name = "ability_runtime" -} -ohos_js_assets("atomizationfahm4_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("atomizationfahm4_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/config.json deleted file mode 100644 index 69b7bec4b69708df48a9562b23b92d723f6178f5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "app": { - "bundleName": "com.example.qianyiyingyong.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.hm2", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "hm4", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:hm4_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 08ec6e2afac1d90aa81fa72b1c3684ead0a65540..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility'; -export default { - onCreate() { - console.info('Application onCreate') - setTimeout(function () { - featureAbility.terminateSelf() - .then((data) => { - console.info('hm4 terminateself succeeded: ' + data); - }).catch((error) => { - console.error('hm4 terminateself failed. Cause: ' + error); - }) - }, 1000); - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 019e8a3953de22c6b4ac10dbe1b7cdc4ed5cae1e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import router from '@system.router'; - -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - -@Entry -@Component -struct Index { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('hm4') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - routePage() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/pages/second.ets deleted file mode 100644 index e728121a18c43f9e395cec7813124a4a3b128874..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/ets/MainAbility/pages/second.ets +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f7546310bc8388ebedbdde9478cc2c49131196f5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "hm4_MainAbility", - "value": "hm4_MainAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json index 41e9fedda72e6e462ecf52266428404babe6e94a..dfef8ab4e10d420e46e4afc03397041e1eabbb8c 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json @@ -16,8 +16,8 @@ "module": { "mainAbility": ".MainAbility1", "deviceType": [ - "default", - "tablet" + "default", + "tablet" ], "abilities": [ { diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..f9c760f7c565112dd9696c629079401e3652d19e 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn deleted file mode 100644 index 6eaaef710dd27d7eed72c0b6e82764b521acfbdb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn +++ /dev/null @@ -1,36 +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("ActsFreeInstallStartAbilityForResultFaTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":actsfreeinstallstartabilityforresultfatest_ets_assets", - ":actsfreeinstallstartabilityforresultfatest_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsFreeInstallStartAbilityForResultFaTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} -ohos_js_assets("actsfreeinstallstartabilityforresultfatest_ets_assets") { - source_dir = "./entry/src/main/ets" - hap_profile = "entry/src/main/config.json" - ets2abc = true -} -ohos_resources("actsfreeinstallstartabilityforresultfatest_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json deleted file mode 100644 index 2759e09a7ec5a27835991f2441f4f2c4290e35c7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "Configuration for freeinstallstartabilityforresultfatest Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "600000", - "bundle-name": "com.open.harmony.startAbilityForResult", - "package-name": "com.open.harmony.startAbilityForResult", - "shell-timeout": "600000", - "testcase-timeout": "50000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFreeInstallStartAbilityForResultFaTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount", - "param set persist.sys.suspend_manager_enabled 0", - "mkdir /data/test/" - ] - }, - { - "type": "PushKit", - "push":[ - "AtomizationResultFaEntry.hap -> /data/test/AtomizationResultFaEntry.hap", - "AtomizationResultFaHm1.hap -> /data/test/AtomizationResultFaHm1.hap", - "AtomizationResultFaHm2.hap -> /data/test/AtomizationResultFaHm2.hap", - "MockService.hap -> /data/test/MockService.hap", - "MockServiceTimeout.hap -> /data/test/MockServiceTimeout.hap", - "AtomizationResultA.hap -> /data/test/AtomizationResultA.hap" - ] - } - ] -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json deleted file mode 100644 index ea117659f53d6cb472ffe333f6328132fdc9df89..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "app": { - "targetBundleList": [ - "com.example.qianyiyingyong.hmservice" - ], - "vendor": "example", - "bundleName": "com.open.harmony.startAbilityForResult", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "mainAbility": ".MainAbility", - "deviceType": [ - "default", - "tablet" - ], - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "formsEnabled": false, - "label": "$string:MainAbility_label", - "type": "page", - "launchType": "singleton" - }, - { - "orientation": "unspecified", - "srcPath": "PageAbility", - "name": ".PageAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:PageAbility_desc", - "formsEnabled": false, - "label": "$string:PageAbility_label", - "type": "page", - "launchType": "standard" - } - ], - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "com.open.harmony.startAbilityForResult", - "srcPath": "", - "name": ".entry", - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".PageAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "reqPermissions": [ - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "reason": "need use ohos.permission.REMOVE_CACHE_FILES", - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE", - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index b29c8974fa850c06194f75c059dcc8bff64ee553..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,32 +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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from "./test/List.test"; - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 81a4a8a511b331159b5a6c75ebc6f531ee27a884..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,62 +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'; -import file from '@system.file'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from "../test/List.test"; -import featureAbility from "@ohos.ability.featureAbility"; - -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info("aboutToAppear start!!!!") - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text(' FA- StartAbilityForResult TEST ') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - routePage() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index e1ceebca9a6898ac11814ec075264d49d1c30240..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/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 StartAbilityForResult from "./StartAbilityForResult.test"; -import StartAbilityForResult2 from "./StartAbilityForResult2.test"; - -export default function testsuite() { - StartAbilityForResult(); - StartAbilityForResult2(); - -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets deleted file mode 100644 index 6feadf98e6ce1b9ca3613669f8469b85700878c2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets +++ /dev/null @@ -1,982 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"; -import Utils from './Utils'; -import featureAbility from "@ohos.ability.featureAbility"; -import wantConstant from '@ohos.ability.wantConstant'; -import abilityManager from '@ohos.application.abilityManager'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -export default function StartAbilityForResult() { - var TAG = ""; - var DeviceId = ""; - - - describe('StartAbilityForResult', function () { - var delegator = AbilityDelegatorRegistry.getAbilityDelegator(); - beforeAll(async function (done) { - console.info("StartAbilityForResult before all called"); - var cmd = "bm install -p data/test/MockService.hap"; - console.info("cmd : " + cmd) - delegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - delegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd3 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" + - "/entry/files"; - delegator.executeShellCommand(cmd3, (err: any, d: any) => { - console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - done(); - }) - }); - - afterEach(async function (done) { - console.info("StartAbilityForResult after each called"); - if ("FreeInstall_FA_StartAbilityForResult_0100" === TAG || - "FreeInstall_FA_StartAbilityForResult_0400" === TAG || - "FreeInstall_FA_StartAbilityForResult_0700" === TAG || - "FreeInstall_FA_StartAbilityForResult_1000" === TAG || - "FreeInstall_FA_StartAbilityForResult_1100" === TAG || - "FreeInstall_FA_StartAbilityForResult_1400" === TAG || - "FreeInstall_FA_StartAbilityForResult_1600" === TAG || - "FreeInstall_FA_StartAbilityForResult_1900" === TAG || - "FreeInstall_FA_StartAbilityForResult_2100" === TAG || - "FreeInstall_FA_StartAbilityForResult_3000" === TAG || - "FreeInstall_FA_StartAbilityForResult_3100" === TAG) { - var cmd4 = "bm uninstall -n com.example.qianyiyingyong.hmservice"; - delegator.executeShellCommand(cmd4, (err: any, d: any) => { - console.info("executeShellCommand4: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var str = { - 'want': { - "bundleName": "com.open.harmony.startAbilityForResult", - "abilityName": "com.open.harmony.startAbilityForResult.MainAbility", - } - } - await featureAbility.startAbility(str).then((data) => { - console.info(' StartAbilityPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(' StartAbilityPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(500); - } - - if ("FreeInstall_FA_StartAbilityForResult_3200" === TAG) { - var cmd14 = "bm uninstall -n com.ohos.hag.famanager"; - delegator.executeShellCommand(cmd14, (err: any, d: any) => { - console.info("executeShellCommand14: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd26 = "bm uninstall -n com.example.myapplicationA.hmserviceA"; - delegator.executeShellCommand(cmd26, (err: any, d: any) => { - console.info("executeShellCommand26: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - } - await Utils.sleep(500); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0100 - * @tc.name: startAbilityForResult: Input empty deviceId,free install and start successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0100", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0100-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0100"; - let details; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0200 - * @tc.name: startAbilityForResult: Send wrong yuanzihua under the path - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0200", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0200-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0200"; - var cmd15 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationResultFaEntry.hap"; - delegator.executeShellCommand(cmd15, (err: any, d: any) => { - console.info("executeShellCommand15: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd16 = "cp data/test/AtomizationResultA.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd16, (err: any, d: any) => { - console.info("executeShellCommand16: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let wrong; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0300 - * @tc.name: startAbilityForResult: Remove the yuanzihua under the path - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0300", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0300-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0300"; - var cmd17 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationResultA.hap"; - delegator.executeShellCommand(cmd17, (err: any, d: any) => { - console.info("executeShellCommand17: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let wrong; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(4); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0400 - * @tc.name: startAbilityForResult: Free install and start successfully (add abilityStartSetting). - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0400", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0400-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0400"; - var cmd18 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd18, (err: any, d: any) => { - console.info("executeShellCommand18: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let details; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0500 - * @tc.name: startAbilityForResult: Send wrong yuanzihua under the path (add abilityStartSetting). - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0500", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0500-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0500"; - var cmd15 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationResultFaEntry.hap"; - delegator.executeShellCommand(cmd15, (err: any, d: any) => { - console.info("executeShellCommand15: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd16 = "cp data/test/AtomizationResultA.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd16, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let wrong; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0600 - * @tc.name: startAbilityForResult: Remove the yuanzihua under the path (add abilityStartSetting). - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0600", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0600-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0600"; - var cmd17 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationResultA.hap"; - delegator.executeShellCommand(cmd17, (err: any, d: any) => { - console.info("executeShellCommand17: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let wrong; - var str = { - 'want': { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(4); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0700 - * @tc.name: startAbilityForResult: No deviceId,free install and start successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0700", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0700-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0700"; - var cmd18 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd18, (err: any, d: any) => { - console.info("executeShellCommand18: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(1000); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0800 - * @tc.name: startAbilityForResult: No deviceId,free install and start successfully (add abilityStartSetting). - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0800", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0800-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0800"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_0900 - * @tc.name: startAbilityForResult: yuanzihua already installed,start successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_0900", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_0900-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_0900"; - var cmd900 = "bm install -p data/test/AtomizationResultFaEntry.hap"; - delegator.executeShellCommand(cmd900, (err: any, d: any) => { - console.info("executeShellCommand900: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(1000); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1000 - * @tc.name: startAbilityForResult: yuanzihua already installed,start successfully (add abilityStartSetting). - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1000", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1000-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1000"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1100 - * @tc.name: startAbilityForResult: Input local deviceId,free install and start successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1100", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1100-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1100"; - let details1; - let details2; - await abilityManager.getTopAbility().then((data) => { - details1 = data; - console.info(' getTopAbility succeeded data: ' + JSON.stringify(data)); - }).catch((error) => { - console.error(' getTopAbility error: ' + JSON.stringify(error)); - }); - console.log(" checkAbilityInfo deviceId : " + details1.deviceId); - DeviceId = details1.deviceId; - await Utils.sleep(500); - var str = { - 'want': { - "deviceId": DeviceId, - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details2 = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details2.resultCode); - expect(details2.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1200 - * @tc.name: startAbilityForResult: Input local deviceId, add abilityStartSetting. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1200", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1200-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1200"; - let details1; - let details2; - await abilityManager.getTopAbility().then((data) => { - details1 = data; - console.info(' getTopAbility succeeded data: ' + JSON.stringify(data)); - }).catch((error) => { - console.error(' getTopAbility error: ' + JSON.stringify(error)); - }); - console.log(" checkAbilityInfo deviceId : " + details1.deviceId); - DeviceId = details1.deviceId; - await Utils.sleep(1000); - var str = { - 'want': { - "deviceId": DeviceId, - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details2 = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details2.resultCode); - expect(details2.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1300 - * @tc.name: startAbilityForResult: Free install feature hap and start successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1300", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1300-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1300"; - var cmd7 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationResultFaEntry.hap"; - delegator.executeShellCommand(cmd7, (err: any, d: any) => { - console.info("executeShellCommand7: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd8 = "cp data/test/AtomizationResultFaHm2.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd8, (err: any, d: any) => { - console.info("executeShellCommand8: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.hm2.MainAbility", - "moduleName": "hnm2", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(3000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1400 - * @tc.name: startAbilityForResult: start feature hap successfully (add abilityStartSetting). - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1400", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1400-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1400"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.hm2.MainAbility", - "moduleName": "hnm2", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1500 - * @tc.name: startAbilityForResult: Call by AsyncCallback. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1500", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1500-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1500"; - var cmd1500 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationResultFaHm2.hap"; - delegator.executeShellCommand(cmd1500, (err: any, d: any) => { - console.info("executeShellCommand1500: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(1000); - var cmd1501 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + - "haps/entry/files"; - delegator.executeShellCommand(cmd1501, (err: any, d: any) => { - console.info("executeShellCommand1501: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(1000); - let details; - var str = { - 'want': { - "bundleName": 'com.example.qianyiyingyong.hmservice', - "abilityName": 'com.example.qianyiyingyong.MainAbility', - "moduleName": 'entry', - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str, (err, data) => { - console.info(TAG + ": StartAbilityForResultCallBack success, err: " + JSON.stringify(err) + - ",data: " + JSON.stringify(data)); - details = data.resultCode; - }) - setTimeout(function () { - console.info(TAG + " resultCode: " + details); - expect(details).assertEqual(1); - done(); - }, 4000); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1600 - * @tc.name: startAbilityForResult: Call by AsyncCallback (add abilityStartSetting). - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1600", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1600-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1600"; - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - }, - 'abilityStartSetting': { - "key": "test:let your heart guide you!" - } - } - await featureAbility.startAbilityForResult(str, (err, data) => { - console.info(TAG + ": StartAbilityForResultCallBack success, err: " + JSON.stringify(err) + - ",data: " + JSON.stringify(data)); - details = data.resultCode; - }) - setTimeout(function () { - console.info(TAG + " resultCode: " + details); - expect(details).assertEqual(1); - done(); - }, 4000); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1700 - * @tc.name: startAbilityForResult: Input wrong flags(22),free install failed. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1700", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1700-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1700"; - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - 'flags': 22 - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1800 - * @tc.name: startAbilityForResult: Input wrong flags('11'),free install failed. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1800", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1800-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1800"; - let wrong; - let startAbilityParameter = { - want: { - bundleName: "com.example.qianyiyingyong.hmservice", - abilityName: "com.example.qianyiyingyong.MainAbility", - moduleName: "entry", - flags: 11 - } - } - await featureAbility.startAbilityForResult(startAbilityParameter) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_1900 - * @tc.name: startAbilityForResult: yuanzihua already installed,input wrong flags('11'),start failed. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_1900", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_1900-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_1900"; - var cmd19 = "bm install -p data/test/AtomizationResultFaEntry.hap"; - delegator.executeShellCommand(cmd19, (err: any, d: any) => { - console.info("executeShellCommand19: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd1901 = "bm install -p data/test/AtomizationResultFaEntry.hap"; - delegator.executeShellCommand(cmd1901, (err: any, d: any) => { - console.info("executeShellCommand1901: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let details; - let startAbilityParameter = { - want: { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - 'flags': 11 - } - } - await featureAbility.startAbilityForResult(startAbilityParameter) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - details = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " errorCode: " + details.code); - expect(details.code).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_2000 - * @tc.name: startAbilityForResult: Input empty flags,free install failed. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_2000", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_2000-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_2000"; - let wrong; - let startAbilityParameter = { - want: { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - 'flags': 0 - } - } - await featureAbility.startAbilityForResult(startAbilityParameter) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_2100 - * @tc.name: startAbilityForResult: yuanzihua already installed,input empty flags,start successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_2100", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_2100-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_2100"; - var cmd19 = "bm install -p data/test/AtomizationResultFaEntry.hap"; - delegator.executeShellCommand(cmd19, (err: any, d: any) => { - console.info("executeShellCommand19: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(1000); - let details; - let startAbilityParameter = { - want: { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - 'flags': 2 - } - } - await featureAbility.startAbilityForResult(startAbilityParameter) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_3000 - * @tc.name: startAbilityForResult: Input different moduleName(feature hap),start feature hap. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_3000", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_3000-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_3000"; - var cmd9 = "bm install -p data/test/AtomizationResultFaHm1.hap"; - delegator.executeShellCommand(cmd9, (err: any, d: any) => { - console.info("executeShellCommand9 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - let details; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "hm1", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_3100 - * @tc.name: startAbilityForResult: Input parameters extended information,free install and start successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_3100", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_3100-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_3100"; - let details; - var str = { - 'want': { - 'deviceId': '', - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - 'parameters': { - "name": "1111", "Ext2": "ExtValue2", "site": "很开心看到你!" - } - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_3200 - * @tc.name: startAbilityForResult: Input wrong moduleName(“xxxxx”), free install failed. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_3200", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_3200-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_3200"; - let wrong; - var str = { - 'want': { - 'deviceId': '', - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "xxxxx", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - expect(wrong.code).assertEqual(1); - done(); - }); - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets deleted file mode 100644 index 8ffc6deee2b9a7cea85e88d801e21bb9c57a97d9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets +++ /dev/null @@ -1,224 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"; -import Utils from './Utils'; -import featureAbility from "@ohos.ability.featureAbility"; -import wantConstant from '@ohos.ability.wantConstant'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -export default function StartAbilityForResult2() { - var TAG = ""; - - describe('StartAbilityForResult2', function () { - var delegator = AbilityDelegatorRegistry.getAbilityDelegator(); - beforeAll(async function (done) { - console.info("StartAbilityForResult before all called"); - var cmd = "bm install -p data/test/MockService.hap"; - console.info("cmd : " + cmd) - delegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - delegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var cmd3 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd3, (err: any, d: any) => { - console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - done(); - }) - }); - - afterEach(async function (done) { - console.info("StartAbilityForResult after each called"); - if ("FreeInstall_FA_StartAbilityForResult_2300" === TAG) { - var cmd4 = "bm uninstall -n com.example.qianyiyingyong.hmservice"; - delegator.executeShellCommand(cmd4, (err: any, d: any) => { - console.info("executeShellCommand4: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - } - - if ("FreeInstall_FA_StartAbilityForResult_2600" === TAG) { - var cmd14 = "bm uninstall -n com.ohos.hag.famanager"; - delegator.executeShellCommand(cmd14, (err: any, d: any) => { - console.info("executeShellCommand14: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - } - await Utils.sleep(500); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_2200 - * @tc.name: startAbilityForResult: The page A not in the foreground. Page A jumps to page B first. - The atomized HAP package has not been installed. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_2200", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_2200-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_2200"; - var str1 = { - 'want': { - "bundleName": "com.open.harmony.startAbilityForResult", - "abilityName": "com.open.harmony.startAbilityForResult.PageAbility", - "moduleName": "entry", - } - } - featureAbility.startAbilityForResult(str1) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise2200 successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise2200 failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(3000); - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise2200 successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise2200 failed. Cause: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000); - expect(wrong.code).assertEqual(13); - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_2300 - * @tc.name: startAbilityForResult: The page A not in the foreground. Page A jumps to page B first. - The atomized HAP package has been installed. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_2300", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_2300-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_2300"; - var cmd19 = "bm install -rp /data/test/AtomizationResultFaEntry.hap"; - console.log("------------start FreeInstall_FA_StartAbilityForResult_2300------install-------"); - delegator.executeShellCommand(cmd19, (err: any, d: any) => { - console.info("executeShellCommand19: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await Utils.sleep(500); - var str1 = { - 'want': { - "bundleName": "com.open.harmony.startAbilityForResult", - "abilityName": "com.open.harmony.startAbilityForResult.PageAbility", - "moduleName": "entry", - } - } - featureAbility.startAbilityForResult(str1) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise2300 successful. Data1: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise2300 failed. Cause1: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000); - setTimeout(async () => { - var wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise2300 successful. 1Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise2300 failed. 1Cause: ' + JSON.stringify(error)); - }) - expect(wrong.code).assertEqual(13); - }, 2000) - done(); - }); - - /* - * @tc.number: FreeInstall_FA_StartAbilityForResult_2600 - * @tc.name: startAbilityForResult: Free install timeout 30s. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_FA_StartAbilityForResult_2600", 0, async function (done) { - console.log("------------start FreeInstall_FA_StartAbilityForResult_2600-------------"); - TAG = "FreeInstall_FA_StartAbilityForResult_2600"; - var cmd20 = "bm uninstall -n com.ohos.hag.famanager"; - delegator.executeShellCommand(cmd20, (err: any, d: any) => { - console.info("executeShellCommand20: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd21 = "bm install -p data/test/MockServiceTimeout.hap"; - delegator.executeShellCommand(cmd21, (err: any, d: any) => { - console.info("executeShellCommand21: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; - delegator.executeShellCommand(cmd1, (err: any, d: any) => { - console.info("executeShellCommand11 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; - delegator.executeShellCommand(cmd2, (err: any, d: any) => { - console.info("executeShellCommand21 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - var cmd3 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - delegator.executeShellCommand(cmd3, (err: any, d: any) => { - console.info("executeShellCommand31 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - - setTimeout(async () => { - var wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - } - await featureAbility.startAbilityForResult(str) - .then((data) => { - console.info(TAG + ' StartAbilityForResultPromise2600 successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - wrong = error; - console.info(TAG + ' StartAbilityForResultPromise2600 failed. Cause: ' + JSON.stringify(error)); - }) - expect(wrong.code).assertEqual(3) - }, 20000) - done(); - }); - - }) -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/Utils.ets deleted file mode 100644 index d1741e6272daeaa9205a8b8a272f6b3cc41a0cc7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/Utils.ets +++ /dev/null @@ -1,131 +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 class Utils { - static rect_left; - static rect_top; - static rect_right; - static rect_bottom; - static rect_value; - - static sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(reject) - }, time) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - static getComponentRect(key) { - let strJson = getInspectorByKey(key); - let obj = JSON.parse(strJson); - console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); - let rectInfo = JSON.parse('[' + obj.$rect + ']') - console.info("[getInspectorByKey] rectInfo is: " + rectInfo); - this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] - this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] - this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] - this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] - return this.rect_value = { - "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom - } - } - - static async swipe(downX, downY, upX, upY, steps) { - console.info('start to swipe') - this.drags(downX, downY, upX, upY, steps, false) - } - - static async drag(downX, downY, upX, upY, steps) { - console.info('start to drag') - this.drags(downX, downY, upX, upY, steps, true) - } - - static async drags(downX, downY, upX, upY, steps, drag) { - var xStep; - var yStep; - var swipeSteps; - var ret; - xStep = 0; - yStep = 0; - ret = false; - swipeSteps = steps; - if (swipeSteps == 0) { - swipeSteps = 1; - } - xStep = (upX - downX) / swipeSteps; - yStep = (upY - downY) / swipeSteps; - console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) - var downPonit: TouchObject = { - id: 1, - x: downX, - y: downY, - type: TouchType.Down, - screenX: 0, - screenY: 1, - } - console.info('down touch started: ' + JSON.stringify(downPonit)) - sendTouchEvent(downPonit); - console.info('start to move') - if (drag) { - await this.sleep(500) - } - for (var i = 1;i <= swipeSteps; i++) { - var movePoint: TouchObject = { - id: 1, - x: downX + (xStep * i), - y: downY + (yStep * i), - type: TouchType.Move, - screenX: 0, - screenY: 1, - } - console.info('move touch started: ' + JSON.stringify(movePoint)) - ret = sendTouchEvent(movePoint) - if (ret == false) { - break; - } - await this.sleep(5) - } - console.info('start to up') - if (drag) { - await this.sleep(100) - } - var upPoint: TouchObject = { - id: 1, - x: upX, - y: upY, - type: TouchType.Up, - screenX: 0, - screenY: 1, - } - console.info('up touch started: ' + JSON.stringify(upPoint)) - sendTouchEvent(upPoint) - await this.sleep(500) - } - - static getNowTime() { - return new Date().getTime(); - } - - static getDurationTime(log,startTime, endTime) { - console.info("Get Interface startTime: " + startTime); - console.info("Get Interface endTime: " + endTime); - var duration = (endTime - startTime); - console.info("Get Interface duration: " + duration); - return duration; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets deleted file mode 100644 index 6e34a29cfb28013273b59fb90ffcb15f2bcdc7b9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets +++ /dev/null @@ -1,34 +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 featureAbility from '@ohos.ability.featureAbility'; - -export default { - onCreate() { - console.info('Applicationfa onCreate') - setTimeout(async () => { - await featureAbility.terminateSelf() - .then((data) => { - console.info('PageAbilityfa terminateself succeeded: ' + data); - }).catch((error) => { - console.error('PageAbilityfa terminateself failed. Cause: ' + error); - }) - }, 8000); - }, - - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/pages/index.ets deleted file mode 100644 index e6d419d27b5849adc22293b52f5abf3232e852e1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World - PageAbility-B' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 06bbc557648940a5153e04c9e584043474ab2a9c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s package','-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - } - - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility' - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e9ceb262bf44ec47c3b68f991b633e3306ae00b4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "PageAbility_desc", - "value": "description" - }, - { - "name": "PageAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json index 477a331589c3213a11f02cb7d96005ea7048af03..7ced28fa427d25f785a3fadc4222cf9dc1b13157 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json @@ -82,35 +82,6 @@ "autoDesignWidth": false } } - ], - "reqPermissions": [ - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "reason": "need use ohos.permission.INSTALL_BUNDLE", - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "reason": "need use ohos.permission.REMOVE_CACHE_FILES", - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE", - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } ] } } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets index 5f5a4e3979468910fe6862f1ffc1e13f6cff6a88..8d2b19fc51126b4a1da925cab9f31d921d252956 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets index 23d8573128944ef812a232f00763839f436817bf..62743ea45b6d88a160dce83e9cb4fde774378304 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets index b1a932cd53e210f6a598c207979dbfa77aa3533d..59a63137a97bfe99d8ea4933c0fba9ce7bcb0765 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +24,7 @@ export default class Utils { static sleep(time) { return new Promise((resolve, reject) => { setTimeout(() => { - resolve(reject) + resolve() }, time) }).then(() => { console.info(`sleep ${time} over...`) @@ -75,8 +76,6 @@ export default class Utils { x: downX, y: downY, type: TouchType.Down, - screenX: 0, - screenY: 1, } console.info('down touch started: ' + JSON.stringify(downPonit)) sendTouchEvent(downPonit); @@ -89,9 +88,7 @@ export default class Utils { id: 1, x: downX + (xStep * i), y: downY + (yStep * i), - type: TouchType.Move, - screenX: 0, - screenY: 1, + type: TouchType.Move } console.info('move touch started: ' + JSON.stringify(movePoint)) ret = sendTouchEvent(movePoint) @@ -109,8 +106,6 @@ export default class Utils { x: upX, y: upY, type: TouchType.Up, - screenX: 0, - screenY: 1, } console.info('up touch started: ' + JSON.stringify(upPoint)) sendTouchEvent(upPoint) @@ -128,4 +123,8 @@ export default class Utils { console.info("Get Interface duration: " + duration); return duration; } -} \ No newline at end of file +} + + + + diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..e83399502e892e74de65c7b92c9032a8f5b36113 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/BUILD.gn deleted file mode 100644 index ed248d759107d9349d6e709bbd75cb2ad66c8f50..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("AtomizationResultA") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":atomizationresulta_ets_assets", - ":atomizationresulta_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "AtomizationResultA" - subsystem_name = "ability" - part_name = "ability_runtime" -} -ohos_js_assets("atomizationresulta_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("atomizationresulta_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/config.json deleted file mode 100644 index cb98eea75c33806c355927ee0ba6582bc7e91188..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplicationA.hmserviceA", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.myapplicationA", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index cb5b2ba7e6ae8c2c801ea5c1f47ee1db567f36b4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/app.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. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 71d9da1d9ceb041abd51816bc9009513fceb741e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import router from '@system.router'; - -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - -@Entry -@Component -struct Index { - 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(() => { - routePage() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/pages/second.ets deleted file mode 100644 index 2feea323a55d9eb313203b69d8a0e048fe7c839b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/ets/MainAbility/pages/second.ets +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 8c525cd4c82a182536e34110ef41cb7f477a0cf1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "package_A" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a1.jpg b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a1.jpg deleted file mode 100644 index 072898889d3562763186a082e59c7aace9979b70..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a1.jpg and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a2.jpg b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a2.jpg deleted file mode 100644 index 072898889d3562763186a082e59c7aace9979b70..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a2.jpg and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a3.jpg b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a3.jpg deleted file mode 100644 index 072898889d3562763186a082e59c7aace9979b70..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a3.jpg and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a4.jpg b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a4.jpg deleted file mode 100644 index 072898889d3562763186a082e59c7aace9979b70..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/a4.jpg and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json index 631a4c5132680cb1d707f995bea08a54f19eef09..802e0b0d44888c9ed3329e0835b55ca69fb62ddf 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json @@ -19,8 +19,8 @@ "mainAbility": ".MainAbility", "srcPath": "", "deviceType": [ - "default", - "tablet" + "default", + "tablet" ], "distro": { "deliveryWithInstall": true, diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..0403c474a60aafea2b33dc61cbedef7ab9f5a33d 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/BUILD.gn deleted file mode 100644 index 745056a198daddb9642ecaa3574f68568a0b2a24..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("AtomizationResultFaHm1") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":atomizationresultfahm1_ets_assets", - ":atomizationresultfahm1_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "AtomizationResultFaHm1" - subsystem_name = "ability" - part_name = "ability_runtime" -} -ohos_js_assets("atomizationresultfahm1_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("atomizationresultfahm1_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/config.json deleted file mode 100644 index 73b27364adacdb22a35fe77d7c384e8b27511ad1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "app": { - "bundleName": "com.example.qianyiyingyong.hmservice", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.qianyiyingyong", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "hm1", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:hm1_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f9c7aa4179805e4010f742aa28fcef016eed746b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.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 featureAbility from '@ohos.ability.featureAbility'; - -export default { - onCreate() { - console.info('Application onCreate') - }, - - onActive(){ - console.info('onActive'); - setTimeout(function () { - console.info('fAStartAbilityForResultPromise terminateSelfWithResult START'); - featureAbility.terminateSelfWithResult( - { - resultCode: 1, - want: - { - bundleName: "com.example.qianyiyingyong.hmservice", - abilityName: "com.example.hm2.MainAbility", - }, - } - ); - console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); - }, 1000); - }, - - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 2bff6de731d4ac935e8ce06a86c4418fd680ece9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,88 +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'; -import featureAbility from '@ohos.ability.featureAbility' - -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - -@Entry -@Component -struct Index { - 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(() => { - routePage() - }) - - Button() { - Text('StartAbilityForResult') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - this.terminateSelfWithResult(); - }) - } - .width('100%') - .height('100%') - } -async terminateSelfWithResult() { - console.info('fAStartAbilityForResultPromise terminateSelfWithResult START'); - await featureAbility.terminateSelfWithResult( - { - resultCode: 1, - want: - { - bundleName: "com.example.qianyiyingyong.hmservice", - abilityName: "com.example.qianyiyingyong.MainAbility", - }, - } - ); - await featureAbility.terminateSelf(); - console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); - } - - async aboutToAppear() { - var permissions = ["ohos.permission.DISTRIBUTED_DATASYNC"]; - featureAbility.getContext().requestPermissionsFromUser(permissions, 0, (data) => { - console.info("start requestPermissionsFromUser!!!!") - }) - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/pages/second.ets deleted file mode 100644 index 9dcd951896be78626c21d48cf64296d4194f8a81..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/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/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/resources/base/element/string.json deleted file mode 100644 index cbf235aa4f985fb9995c84c837dc5d50ab6bc014..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "hm1_MainAbility", - "value": "相同BN和AN" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/BUILD.gn deleted file mode 100644 index 5fa0d66f150b7c643d673668c1579eb7f83047d7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("AtomizationResultFaHm2") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":atomizationresultfahm2_ets_assets", - ":atomizationresultfahm2_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "AtomizationResultFaHm2" - subsystem_name = "ability" - part_name = "ability_runtime" -} -ohos_js_assets("atomizationresultfahm2_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("atomizationresultfahm2_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/config.json deleted file mode 100644 index 7f69887982444b3f4c5da9b8a7e359e862547d3b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "app": { - "bundleName": "com.example.qianyiyingyong.hmservice", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.hm2", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "hnm2", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:hnm2_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f9c7aa4179805e4010f742aa28fcef016eed746b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.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 featureAbility from '@ohos.ability.featureAbility'; - -export default { - onCreate() { - console.info('Application onCreate') - }, - - onActive(){ - console.info('onActive'); - setTimeout(function () { - console.info('fAStartAbilityForResultPromise terminateSelfWithResult START'); - featureAbility.terminateSelfWithResult( - { - resultCode: 1, - want: - { - bundleName: "com.example.qianyiyingyong.hmservice", - abilityName: "com.example.hm2.MainAbility", - }, - } - ); - console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); - }, 1000); - }, - - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 65e3f950d5d99620b8a332ce73f138b92d81d720..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,143 +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'; -import featureAbility from '@ohos.ability.featureAbility' -import wantConstant from '@ohos.ability.wantConstant' -import Prompt from '@system.prompt'; - -const BUNDLE_NAME = 'com.example.qianyiyingyong.hmservice'; -const ABILITY_NAME1 = 'com.example.hm2.MainAbility'; - -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - -@Entry -@Component -struct Index { - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('HNM2 next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - routePage() - }) - - Text('fAStartAbilityPromiseSameBundleName1 本设备,feature覆盖安装') - .height(70) - .width('100%') - .fontSize(20) - .fontColor(Color.White) - .fontWeight(FontWeight.Bold) - .margin({ top: 20 }) - .backgroundColor(Color.Grey) - .onClick(() => { - var str = { - 'want': { - 'bundleName': BUNDLE_NAME, - 'abilityName': ABILITY_NAME1, - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - }; - this.fAStartAbilityPromise('fAStartAbilityPromiseSameBundleName1', str); - - }); - - Button() { - Text('StartAbilityForResult') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - this.terminateSelfWithResult(); - }) - } - .width('100%') - .height('100%') - } - - async aboutToAppear() { - var permissions = ["ohos.permission.DISTRIBUTED_DATASYNC"]; - featureAbility.getContext().requestPermissionsFromUser(permissions, 0, (data) => { - console.info("start requestPermissionsFromUser!!!!") - }) - } - - async terminateSelfWithResult() { - console.info('fAStartAbilityForResultPromise terminateSelfWithResult START'); - await featureAbility.terminateSelfWithResult( - { - resultCode: 1, - want: - { - bundleName: "com.example.qianyiyingyong.hmservice", - abilityName: "com.example.hm2.MainAbility", - }, - } - ); - await featureAbility.terminateSelf(); - console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); - } - - async fAStartAbilityPromise(tag, str) { - console.info(tag + ' startAbility fAStartAbilityPromise START' + JSON.stringify(str)); - let code; - await featureAbility.startAbility(str) - .then((data) => { - console.info(tag + ' startAbility Operation successful. Promise Data: ' + JSON.stringify(data)) - code = data; - }).catch((error) => { - console.info(tag + ' startAbility Operation failed. Promise Cause: ' + JSON.stringify(error)); - code = error; - }) - console.info(tag + ' startAbility Operation code Promise: ' + JSON.stringify(code)); - if (code === 0) { - this.tips('成功'); - } else { - this.tips('错误码:' + code.code); - } - console.info(tag + ' startAbility fAStartAbilityPromise END'); - } - - tips(msg) { - Prompt.showToast({ - message: msg, - duration: 2000, - bottom: '150px' - }); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/pages/second.ets deleted file mode 100644 index 6e0296ed6e5ec446039002974e449266f2ed14f4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/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 = "HNM2 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/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 8380229de102511d01d094185835cbe3c975d9d8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "hnm2_MainAbility", - "value": "相同BN不同AN" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..e83399502e892e74de65c7b92c9032a8f5b36113 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets index e4f5fddd4c49e03df0bc0adfb8638c3eadffa7d7..3826d4124548dc5163ca756f5815d3a841cb790f 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets index 3a1bdfebd3435416372fa84fc2ccf2901a11c134..50401d70debde0d73f2518fe9b09aa1cb5e363a5 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json index 5772ab67c68ab5c6b0942eb4f8f8165e550546d0..6180dbba72246deffaafb5d2586edf9f0f3024ca 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json @@ -35,17 +35,11 @@ ], "requestPermissions": [ { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + "name": "ohos.permission.DISTRIBUTED_DATASYNC" }, { "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC" - } + } ] } } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..c84f04685a7f61f504e7dfb6048a6447348fa8d5 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets index 033d4482bc64554e7196370eff24d966b96ce1cb..24a6152449c41795122a3f88a2d0d2a8335cfb91 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets index 415cf85229571824eb4b8c9972d759fa105d117d..bb18e341f133c11d6c6ec184b671a2318ccca1b0 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -67,36 +68,6 @@ export default function StartAbilityForResult(abilityContext) { done(); }); - /* - * @tc.number: FreeInstall_Stage_StartAbilityForResult_2400 - * @tc.name: startAbilityForResult: don't add targetBundleList,free install and start hap successfully. - * @tc.desc: Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_StartAbilityForResult_2400", 0, async function (done) { - console.log("------------start FreeInstall_Stage_StartAbilityForResult_2400-------------"); - TAG = "FreeInstall_Stage_StartAbilityForResult_2400"; - let details; - var str = { - "deviceId": "", - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - await globalThis.abilityContext.startAbilityForResult(str) - .then((data) => { - details = data; - console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) - }).catch((error) => { - console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); - }) - await sleep(2000); - console.log(TAG + " resultCode: " + details.resultCode); - expect(details.resultCode).assertEqual(1); - done(); - }); - /* * @tc.number: FreeInstall_Stage_StartAbilityForResult_2500 * @tc.name: startAbilityForResult: don't add targetBundleList, app already installed, start hap successfully. diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json index 5772ab67c68ab5c6b0942eb4f8f8165e550546d0..4f0eb835069cfdbc7cdb65d39417086876bc9cfd 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json @@ -35,16 +35,10 @@ ], "requestPermissions": [ { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + "name": "ohos.permission.DISTRIBUTED_DATASYNC" }, { "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC" } ] } diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..c84f04685a7f61f504e7dfb6048a6447348fa8d5 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..9501894d5cf93144093de4caa01cb32ab162cedc 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..9501894d5cf93144093de4caa01cb32ab162cedc 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..9501894d5cf93144093de4caa01cb32ab162cedc 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..522ee12106c397c3b17abc81ea000a3dd2f0bb78 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 593dc9add0f7bdd6b7b988a96dbe685ebc730c31..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,63 +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 wantConstant from '@ohos.ability.wantConstant'; -import commonEvent from '@ohos.commonEvent'; - -var publishOptions = { - parameters: { - "assertData": "onSuccess" - } -}; - -function PublishCallBack(err) { - if (err.code) { - console.error("ConnectAbilityTest_Ext service publish failed " + JSON.stringify(err)); - } else { - console.info("ConnectAbilityTest_Ext service publish success!!!"); - } -} - -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate() { - console.info('ServiceAbility2 onCreate'); - } - - onRequest(want, startId) { - console.info('ServiceAbility2 onRequest, want: ' + want.abilityName); - console.info('ServiceAbility2 onRequest, startId: ' + startId); - console.info('ServiceAbility2 onRequest'); - let str = { - 'deviceId': '', - 'bundleName': 'com.example.qianyiyingyong.hmservice', - 'abilityName': 'com.example.qianyiyingyong.ServiceAbility', - 'moduleName': 'entry', - 'flags': wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - console.info('ServiceAbility2 onRequest START, str is : ' + JSON.stringify(str)); - - this.context.startAbility(str).then((data) => { - console.info("ServiceAbility2 onRequest data: " + JSON.stringify(data)) - commonEvent.publish("service_event",publishOptions,PublishCallBack); - }).catch((error) => { - console.info("ServiceAbility2 onRequest error: " + JSON.stringify(error)) - }) - } - - onDestroy() { - console.info('ServiceAbility2 onDestroy'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets index 632b83a186efa41e9c789f740cf648ea6d1dfe39..cf044dab7bf62aeb0e2f36c5fd1eb19d1126a177 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets index d80628c920d584a4ba2983771552fb5d1e69c08f..d5b979d2f24cf2ec2dcb0739a861721530e0d4c1 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets index 3b14725f96e43e414aaba9235474c2533e4de3ae..36c43fbb00ae5350d25741656bcd8bfa919ff706 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets @@ -1,3 +1,6 @@ +// @ts-nocheck + + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -418,68 +421,6 @@ export default function startAbilityTest(abilityContext) { done(); }); - /* - * @tc.number FreeInstall_Stage_Local_StartAbility_0900 - * @tc.name Do not transfer deviceid, use callback to realize installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_Local_StartAbility_0900", 0, async function (done) { - console.info("------------start FreeInstall_Stage_Local_StartAbility_0900-------------"); - TAG = "FreeInstall_Stage_Local_StartAbility_0900"; - var cmd900 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationStageHm2.hap"; - globalThis.delegator.executeShellCommand(cmd900, (err: any, d: any) => { - console.info("executeShellCommand900 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - var cmd901 = "cp data/test/AtomizationStageEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" + - "entry/files"; - globalThis.delegator.executeShellCommand(cmd901, (err: any, d: any) => { - console.info("executeShellCommand901 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); - }) - await sleep(500); - abilityForeground(TAG); - await sleep(1000); - var str = { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - globalThis.abilityContext.startAbility(str, (error, data) => { - console.log(TAG + ": startAbility err: " + JSON.stringify(error) + ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue(); - }) - await sleep(2000); - console.info("------------end FreeInstall_Stage_Local_StartAbility_0900-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_Stage_Local_StartAbility_1000 - * @tc.name Do not transmit deviceid, and use callback to automatically pull up installed applications - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_Local_StartAbility_1000", 0, async function (done) { - console.info("------------start FreeInstall_Stage_Local_StartAbility_1000-------------"); - TAG = "FreeInstall_Stage_Local_StartAbility_1000"; - abilityForeground(TAG); - await sleep(1000); - var str = { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, - } - globalThis.abilityContext.startAbility(str, (error, data) => { - console.log(TAG + ": startAbility err: " + JSON.stringify(error) + ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue(); - }) - await sleep(2000); - console.info("------------end FreeInstall_Stage_Local_StartAbility_1000-------------"); - done(); - }); /* * @tc.number FreeInstall_Stage_Local_StartAbility_1100 @@ -1118,33 +1059,6 @@ export default function startAbilityTest(abilityContext) { done(); }); - /* - * @tc.number FreeInstall_Stage_Local_StartAbility_3500 - * @tc.name Service to pull up the service of the atomized service to realize the installation free process - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_Stage_Local_StartAbility_3500", 0, async function (done) { - console.info("------------start FreeInstall_Stage_Local_StartAbility_3500-------------"); - TAG = "FreeInstall_Stage_Local_StartAbility_3500"; - commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack); - abilityForeground(TAG); - await sleep(1000); - var str = { - "bundleName": "com.open.harmony.packagemag", - "abilityName": "com.open.harmony.packagemag.ServiceAbility", - } - globalThis.abilityContext.startAbility(str).then((data) => { - console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); - }); - await sleep(2000); - expect(result).assertEqual("onSuccess"); - console.info("------------end FreeInstall_Stage_Local_StartAbility_3500-------------"); - done(); - }); - /* * @tc.number FreeInstall_Stage_Local_StartAbility_1900 * @tc.name The current service is not in the foreground. Page a jumps to page B first. diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json index a4f6dcd2acac0b72ffda7398dd17fb5d38164a4c..4b48fee0b5c28edbd7613a24c6a5f4cb010fc427 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json @@ -41,38 +41,14 @@ } ], "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, { "name": "ohos.permission.DISTRIBUTED_DATASYNC" }, { - "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND" + "name": "ohos.permission.GET_BUNDLE_INFO" }, { - "name": "ohos.permission.START_INVISIBLE_ABILITY" - } - ], - "extensionAbilities": [ - { - "name": "com.open.harmony.packagemag.ServiceAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "label": "$string:form_ServiceAbility_label", - "description": "$string:form_ServiceAbility_desc", - "type": "service", - "metadata": [ - { - "name": "ohos.extension.form", - "resource": "$profile:form_config" - } - ] + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" } ] } diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..7a22b18bc60941452abf705092b8af1a4d21a3d0 100755 Binary files a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets index fbc1488ca52444364b9e13c7f6ce8a7c3f82ba84..ac8ffd4dac7495a2ce625c0437fc2463fe4e1fc9 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets index d7d460904bda55a755997542602f423666e92df2..1f0e8793d2fe0ae636b57e06a0115556d1a168cd 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets @@ -1,3 +1,5 @@ +// @ts-nocheck + /** * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..6ea1f57a1e330396e8bc99a833309793809b68ac 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json index 3e1063d9dd551afe5581570b310221b0d65f0b12..dd22b61cbeab684cbaa9278e837cdade5d3292c9 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json @@ -35,16 +35,10 @@ ], "requestPermissions": [ { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + "name": "ohos.permission.DISTRIBUTED_DATASYNC" }, { "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC" } ], "extensionAbilities": [ diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..9501894d5cf93144093de4caa01cb32ab162cedc 100755 Binary files a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json index 71879587c36fd42db5a5c7bfac23c3e302ce56b6..76b8db711fc8ffc00d409b4eb9f21502f7aa81a5 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json @@ -35,16 +35,10 @@ ], "requestPermissions": [ { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + "name": "ohos.permission.DISTRIBUTED_DATASYNC" }, { "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC" } ] } diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..9501894d5cf93144093de4caa01cb32ab162cedc 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..9501894d5cf93144093de4caa01cb32ab162cedc 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..6ea1f57a1e330396e8bc99a833309793809b68ac 100644 Binary files a/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/signature/openharmony_sx.p7b and b/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json index 094fabb55615394f0f3ffc2a075f66af2512277c..a6d0dcf4ce736a376e07bc79a4db1035b051edea 100644 --- a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json +++ b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json @@ -17,8 +17,8 @@ "package": "com.example.newwanthapapi7", "name": ".MyApplication", "deviceType": [ - "default", - "tablet" + "default", + "tablet" ], "distro": { "deliveryWithInstall": true, @@ -47,33 +47,9 @@ } ], "reqPermissions": [ - { - "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.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" } ], "js": [ diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..562c6ff7788c72d8ae2fa449e1c0fe2408adb9b6 100644 Binary files a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json index 0b74378dedc07ce0c098a4921ad7dffcb41e9530..849da36abd721b4c83ec3376ff7f41423a61547f 100644 --- a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json +++ b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -36,33 +36,9 @@ } ], "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.START_ABILITIES_FROM_BACKGROUND", - "reason": "need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" } ] } diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..9ab79feef4e381f5d172fa4265c75fbaaec870f4 100644 Binary files a/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json index eeec2f35c4cd388e245ea1900d7fa115158d8790..ff46a35ecd219644022ae4c31dbfe09468066f1e 100644 --- a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json +++ b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -36,33 +36,9 @@ } ], "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.START_ABILITIES_FROM_BACKGROUND", - "reason": "need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" } ] } diff --git a/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..8a1913b766bc0866c0609b749920bdfd6dcf4d48 100644 Binary files a/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts index 9905a3a2eb03b0efb8d1e145c529880b80d91793..0c6688dcc3ef7ca3085cd4d36ca3b31f0183d60e 100644 --- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -81,10 +81,10 @@ export default class MainAbility extends Ability { }) } if (globalThis.abilityWant.action == 'startMainAbility0700') { - globalThis.abilityContext.connectServiceExtensionAbility({ + globalThis.abilityContext.startAbility({ bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.ServiceAbility", - action: "connectServiceAbility0700" + abilityName: "com.example.newwanthapa.SecondAbility", + action: "restartSecondAbility0700" }, (error, data) => { console.log('ACTS_NewWant MainAbility onForeground - startAbility startServiceAbility: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 213d8a9b8b8c9edbf692aa94ab21dbc540496f9e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /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 ServiceExtension from '@ohos.application.ServiceExtensionAbility'; -import Want from '@ohos.application.Want'; -import rpc from "@ohos.rpc"; - -function sleep(delay) { - let start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } -} - -export default class ServiceAbility extends ServiceExtension { - onCreate(want: Want) { - globalThis.abilityWant = want; - console.log('ACTS_NewWant ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ACTS_NewWant ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want) { - sleep(1000) - var connId; - console.log('ACTS_NewWant ServiceAbility onConnect, want:' + want.abilityName); - globalThis.extensionContext = this.context - if (globalThis.abilityWant.action == 'connectServiceAbility0700') { - console.log('ACTS_NewWant ServiceAbility onConnect, action:' + globalThis.abilityWant.action); - this.context.startAbility( - { - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.SecondAbility", - action: "restartSecondAbility0700" - }, - ) - } - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ACTS_NewWant ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ACTS_NewWant ServiceAbility onDestroy'); - } -}; diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index 8f18a61d57fe4cc71cd70bae4d9378d284df0e2c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/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/newwant/actsnewwantrelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json index 4e8e4f6ffa250c2771911ad3de10a81810a16243..2b356a796093007e7a684fbb22a2e82aa0dcbcb7 100644 --- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -45,45 +45,10 @@ "launchType": "singleton" } ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.newwanthapa.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, { "name": "ohos.permission.GET_BUNDLE_INFO", "reason": "need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason": "need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" } ] } diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..8a1913b766bc0866c0609b749920bdfd6dcf4d48 100755 Binary files a/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json index ee20a2b344914860c82404b147a8e4148e7fe128..f8213cbeb779cdfa36b4c9fb06217a20f27f0e71 100644 --- a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json +++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -36,49 +36,13 @@ } ], "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS", - "reason": "need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.GET_RUNNING_INFO", - "reason": "need use ohos.permission.GET_RUNNING_INFO" - }, { "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" }, { - "name": "ohos.permission.CLEAN_APPLICATION_DATA", - "reason": "need use ohos.permission.CLEAN_APPLICATION_DATA" - }, - { - "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason": "need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.GET_BUNDLE_INFO" } ] } diff --git a/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..fb73cb2102adb0e4650d718689414f394ee9ad9e 100644 Binary files a/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 77bc1694c1374b3055ad904f2a64acd3a6f6464c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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; - } -} -function PublishCallBackOne8() { - console.debug("====>Publish CallBack ACTS_AbilityPermission_0400====>"); - console.debug("====>close this context====>0400====>") -} -export default class ServiceAbility extends ServiceExtension { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - console.log('ServiceAbility onConnect, action:' + want.action); - if (want.action == 'StartAbilityPromise') { - commonEvent.publish("ACTS_AbilityPermission_0400_Start_CommonEvent", PublishCallBackOne8); - var myStub = new Stub("com.example.actsabilitypermissiontest.ServiceAbility"); - console.log('ThirdAbility onConnect before returnU100:') - return myStub; - console.log('after return') - } - } - - 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/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index af219b5e18c7a8228170921c67c330c9e0f9df36..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/acts_systemappa_test/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/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets index f45d30bb0a5989943574c030c23de6e58615d5d6..69f48355c9fcf7d53665c4ac8fb7333dc06741b2 100644 --- a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// @ts-nocheck import osaccount from '@ohos.account.osAccount' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import commonEvent from '@ohos.commonEvent' @@ -21,9 +22,6 @@ var AbilityPermission1 = { var AbilityPermission3 = { events: ["ACTS_AbilityPermission_0300_Start_CommonEvent"] } -var AbilityPermission4 = { - events: ["ACTS_AbilityPermission_0400_Start_CommonEvent"] -} var AbilityPermission6 = { events: ["ACTS_AbilityPermission_0600_Start_CommonEvent"] } @@ -144,82 +142,6 @@ export default function abilityPermissionTest() { setTimeout(timeout, START_ABILITY_TIMEOUT); }) - /* - * @tc.number: ACTS_AbilityPermission_0400 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Bind an Ability to which you belong with the current user - */ - it('ACTS_AbilityPermission_0400', 0, async function (done) { - console.log("ACTS_AbilityPermission_0400====>callback start====>") - let Subscriber - var flag = true - - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_AbilityPermission_0400_Start_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - } - - function onConnectCallback(element, remote) { - console.log('ACTS_AbilityPermission_0400_Start_CommonEvent onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_AbilityPermission_0400_Start_CommonEvent onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_AbilityPermission_0400_Start_CommonEvent - 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.unsubscribe(Subscriber, UnSubscribeCallback) - } - - commonEvent.createSubscriber(AbilityPermission4).then(async (data) => { - console.debug("====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsabilitypermissiontest', - abilityName: 'com.example.actsabilitypermissiontest.ServiceAbility', - action: "StartAbilityPromise" - }, userA, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - done() - } - - function timeout() { - console.debug('in ACTS_AbilityPermission_0400_Start_CommonEvent timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_AbilityPermission_0400_Start_CommonEvent - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - /* * @tc.number: ACTS_AbilityPermission_0600 * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json index e8bff553007d3ae4be5a54871b7654ef2729956b..82a0380edc07096c6e467fe6d9877bd414b1a2c7 100644 --- a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -53,77 +53,14 @@ ] } ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsabilitypermissiontest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, { "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" }, { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - }, - { - "name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.INTERACT_ACROSS)LOCAL_ACCOUNTS_EXTENSION", - "reason":"need use ohos.permission.INTERACT_ACROSS)LOCAL_ACCOUNTS_EXTENSION" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name":"ohos.permission.START_INVISIBLE_ABILITY", - "reason":"need use ohos.permission.START_INVISIBLE_ABILITY" + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" } ] } diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b b/ability/ability_runtime/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..8301816f15114e3514d24a5e04fee1f354d835ce 100755 Binary files a/ability/ability_runtime/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b and b/ability/ability_runtime/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index b0945501c0667c0feb6f22bb9868d639221349b0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.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 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; - } -} -function PublishCallBackOne8() { - console.debug("====>Publish CallBack ACTS_AbilityPermission_0600====>"); - console.debug("====>close this context====>0600====>") -} -export default class ServiceAbility extends ServiceExtension { - onCreate(want) { - console.log('====>user101====>') - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - if (want.action == 'StartAbilityPromise') { - commonEvent.publish("ACTS_AbilityPermission_0600_Start_CommonEvent", PublishCallBackOne8); - var myStub = new Stub("com.example.actssystemappuonehundredonerelytest.ServiceAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - } - - 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/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index af219b5e18c7a8228170921c67c330c9e0f9df36..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/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/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json index f8d47284ebe28c5a8a121514ce665dc1dee3d592..7d216453ecbb068459e156ae39950f39ec663f54 100644 --- a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -33,17 +33,6 @@ } ] } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actssystemappuonehundredonerelytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } ] } } diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..ed7021225f11a1b8f0d987d9c786930a0a2a7ef0 100755 Binary files a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b and b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100755 index 00537164520f1e7f4713bd890c9a9e2e3a5b338c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,61 +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; - } -} -function PublishCallBackOne8() { - console.debug("====>Publish CallBack ACTS_ThirdPartyAbilityPermission_0400====>"); - console.debug("====>close this context====>0400====>") -} -export default class ServiceAbility extends ServiceExtension{ - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - console.log('ServiceAbility onConnect, action:' + want.action); - if (want.action == 'StartAbilityPromise') { - commonEvent.publish("ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent", PublishCallBackOne8); - var myStub = new Stub("com.example.actsabilitypermissionthirdtest.ServiceAbility"); - console.log('ThirdAbility onConnect before returnU100:') - console.log('after return') - return myStub; - } - } - - 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/non_concurrent/actsthirdappatest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100755 index eeded288941dc3898e44cab2082e800f6b6f8a14..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/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/non_concurrent/actsthirdappatest/entry/src/main/ets/test/AbilityPermission.test.ets b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/AbilityPermission.test.ets index 163f650a78adf17bd18d92293d9f5956851e97c5..b76f99e9319e13eb863f324b3f4dd1819aa59c18 100755 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/AbilityPermission.test.ets +++ b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/AbilityPermission.test.ets @@ -21,9 +21,6 @@ var AbilityPermission1 = { var AbilityPermission3 = { events: ["ACTS_ThirdPartyAbilityPermission_0300_Start_CommonEvent"] } -var AbilityPermission4 = { - events: ["ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent"] -} var AbilityPermission6 = { events: ["ACTS_ThirdPartyAbilityPermission_0600_Start_CommonEvent"] } @@ -125,85 +122,6 @@ export default function abilityPermissionTest() { setTimeout(timeout, START_ABILITY_TIMEOUT); }) - /* - * @tc.number: ACTS_ThirdPartyAbilityPermission_0400 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Bind an Ability to which you belong with the current user - */ - it('ACTS_ThirdPartyAbilityPermission_0400', 0, async function (done) { - console.log("ACTS_ThirdPartyAbilityPermission_0400====>callback start====>") - let Subscriber - var flag = true - - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - } - - function onConnectCallback(element, remote) { - console.log('ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent onConnectCallback====>'+ - ' element=' + JSON.stringify(element)); - console.log('ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent onConnectCallback====>'+ - ' remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent - 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.unsubscribe(Subscriber, UnSubscribeCallback) - } - - commonEvent.createSubscriber(AbilityPermission4).then(async (data) => { - console.debug("====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsabilitypermissionthirdtest', - abilityName: 'ServiceAbility', - action: "StartAbilityPromise" - }, userA, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - done() - } - - function timeout() { - console.debug('in ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ThirdPartyAbilityPermission_0400_Start_CommonEvent - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - /* * @tc.number: ACTS_ThirdPartyAbilityPermission_0600 * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/module.json index 22cbe512b90f2d351b5727a411d0f282e3b6b246..88cdbb44ad85e1104fce4301a0c805b2b97b6be1 100755 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/module.json +++ b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/module.json @@ -41,17 +41,6 @@ "label": "$string:MainAbility2_label", "launchType": "standard" } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:Service_desc", - "label": "$string:Service_label", - "type": "service|dataShare" - } ] } } diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/signature/openharmony_sx.p7b b/ability/ability_runtime/non_concurrent/actsthirdappatest/signature/openharmony_sx.p7b index f06e218defa7f707e22a3890903c574e1c498217..a51eeb213f705970c4e887336a4535d0a8bee74d 100755 Binary files a/ability/ability_runtime/non_concurrent/actsthirdappatest/signature/openharmony_sx.p7b and b/ability/ability_runtime/non_concurrent/actsthirdappatest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100755 index c128900cec9d80c41c2818de1d712c5485b921cb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.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 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; - } -} -function PublishCallBackOne8() { - console.debug("====>Publish CallBack ACTS_ThirdPartyAbilityPermission_0600====>"); - console.debug("====>close this context====>0600====>") -} -export default class ServiceAbility extends ServiceExtension { - onCreate(want) { - console.log('====>user101====>') - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - if (want.action == 'StartAbilityPromise') { - commonEvent.publish("ACTS_ThirdPartyAbilityPermission_0600_Start_CommonEvent", PublishCallBackOne8); - var myStub = new Stub("com.example.actsthirdappuonehundredone.ServiceAbility"); - console.log('ThirdAbility onConnect before return:') - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - return myStub; - } - } - - 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/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100755 index eeded288941dc3898e44cab2082e800f6b6f8a14..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/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/non_concurrent/actsthirdapponerelytest/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/module.json index 6e02fafea0ee46c770e689a64bd8544cfdb4623a..d60d0b2098bc014f53359a2f39c6273547b4db98 100755 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/module.json +++ b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/module.json @@ -33,17 +33,6 @@ } ] } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service|dataShare", - "visible": true - } ] } } diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/signature/openharmony_sx.p7b b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/signature/openharmony_sx.p7b index f06e218defa7f707e22a3890903c574e1c498217..a17c87cfc0e75981bfd604b8640a24ba00d0921a 100755 Binary files a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/signature/openharmony_sx.p7b and b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/signature/openharmony_sx.p7b differ