diff --git a/ability/ability_runtime/freeinstalltest/BUILD.gn b/ability/ability_runtime/freeinstalltest/BUILD.gn index 2553b8661cf4bc3d25283e28a9edd09227ac37eb..7afe0fa513611aea0314558808777abdc19418b7 100644 --- a/ability/ability_runtime/freeinstalltest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/BUILD.gn @@ -17,6 +17,7 @@ group("freeinstalltest") { testonly = true if (is_standard_system) { deps = [ + "connectabilityfatest/actsfreeinstallconnectabilityfatest:ActsFreeInstallConnectAbilityFaTest", "connectabilityfatest/connectdifferentapplication:ConnectDifferentApplication", "connectabilityfatest/connectfamyapplication1:ConnectFaMyApplication1", "connectabilityfatest/connectfamyapplication10:ConnectFaMyApplication10", @@ -28,7 +29,7 @@ group("freeinstalltest") { "connectabilityfatest/connectfamyapplication7:ConnectFaMyApplication7", "connectabilityfatest/connectfamyapplication8:ConnectFaMyApplication8", "connectabilityfatest/connectfamyapplication9:ConnectFaMyApplication9", - "connectabilityfatest/freeinstallconnectabilityfatest:FreeInstallConnectAbilityFaTest", + "connectabilitystagetest/actsfreeinstallconnectabilitystagetest:ActsFreeInstallConnectAbilityStageTest", "connectabilitystagetest/connectstagemyapplication0:ConnectStageMyApplication0", "connectabilitystagetest/connectstagemyapplication1:ConnectStageMyApplication1", "connectabilitystagetest/connectstagemyapplication2:ConnectStageMyApplication2", @@ -38,34 +39,33 @@ group("freeinstalltest") { "connectabilitystagetest/connectstagemyapplication6:ConnectStageMyApplication6", "connectabilitystagetest/connectstagemyapplication7:ConnectStageMyApplication7", "connectabilitystagetest/connectstagemyapplication8:ConnectStageMyApplication8", - "connectabilitystagetest/freeinstallconnectabilitystagetest:FreeInstallConnectAbilityStageTest", "mockservice:MockService", "mockservicetimeout:MockServiceTimeout", + "startabilityfatest/actsfreeinstallstartabilityfatest:ActsFreeInstallStartAbilityFaTest", + "startabilityfatest/actsstartabilitynotargetbundlelistfatest:ActsStartAbilityNoTargetBundleListFaTest", "startabilityfatest/atomizationfaentry:AtomizationFaEntry", "startabilityfatest/atomizationfahm2:AtomizationFaHm2", "startabilityfatest/atomizationfahm4:AtomizationFaHm4", "startabilityfatest/famyapplication1:FaMyApplication1", - "startabilityfatest/freeinstallstartabilityfatest:FreeInstallStartAbilityFaTest", - "startabilityfatest/startabilitynotargetbundlelistfatest:StartAbilityNoTargetBundleListFaTest", + "startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest:ActsFreeInstallStartAbilityForResultFaTest", + "startabilityforresultfatest/actsstartabilityforresultnotargetfatest:ActsStartAbilityForResultNoTargetFaTest", "startabilityforresultfatest/atomizationresulta:AtomizationResultA", "startabilityforresultfatest/atomizationresultfaentry:AtomizationResultFaEntry", "startabilityforresultfatest/atomizationresultfahm1:AtomizationResultFaHm1", "startabilityforresultfatest/atomizationresultfahm2:AtomizationResultFaHm2", "startabilityforresultfatest/faresultmyapplication1:FaResultMyApplication1", - "startabilityforresultfatest/freeinstallstartabilityforresultfatest:FreeInstallStartAbilityForResultFaTest", - "startabilityforresultfatest/startabilityforresultnotargetfatest:StartAbilityForResultNoTargetFaTest", + "startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest:ActsFreeInstallStartAbilityForResultStageTest", + "startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest:ActsStartAbilityForResultNoTargetBundleListStageTest", "startabilityforresultstagetest/atomizationresultstageentry:AtomizationResultStageEntry", "startabilityforresultstagetest/atomizationresultstagehm2:AtomizationResultStageHm2", "startabilityforresultstagetest/atomizationresultstagehnm2:AtomizationResultStageHnm2", - "startabilityforresultstagetest/freeinstallstartabilityforresultstagetest:FreeInstallStartAbilityForResultStageTest", "startabilityforresultstagetest/stageresultmyapplication1:StageResultMyApplication1", - "startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest:StartAbilityForResultNoTargetBundleListStageTest", + "startabilitystagetest/actsfreeinstallstartabilitystagetest:ActsFreeInstallStartAbilityStageTest", + "startabilitystagetest/actsstartabilitynotargetbundleliststagetest:ActsStartAbilityNoTargetBundleListStageTest", "startabilitystagetest/atomizationstageentry:AtomizationStageEntry", "startabilitystagetest/atomizationstagehm2:AtomizationStageHm2", "startabilitystagetest/atomizationstagehm4:AtomizationStageHm4", - "startabilitystagetest/freeinstallstartabilitystagetest:FreeInstallStartAbilityStageTest", "startabilitystagetest/stagemyapplication1:StageMyApplication1", - "startabilitystagetest/startabilitynotargetbundleliststagetest:StartAbilityNoTargetBundleListStageTest", ] } } diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/BUILD.gn similarity index 72% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/BUILD.gn index f220be14067f7265ae3974515b2bee0dc2d09890..037f19180a747c59bc3f01c27622f869da65e2f9 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/BUILD.gn @@ -13,22 +13,22 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("FreeInstallStartAbilityFaTest") { +ohos_js_hap_suite("ActsFreeInstallConnectAbilityFaTest") { hap_profile = "./entry/src/main/config.json" deps = [ - ":freeinstallstartabilityfatest_ets_assets", - ":freeinstallstartabilityfatest_ets_resources", + ":actsfreeinstallconnectabilityfatest_ets_assets", + ":actsfreeinstallconnectabilityfatest_ets_resources", ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FreeInstallStartAbilityFaTest" + hap_name = "ActsFreeInstallConnectAbilityFaTest" } -ohos_js_assets("freeinstallstartabilityfatest_ets_assets") { +ohos_js_assets("actsfreeinstallconnectabilityfatest_ets_assets") { source_dir = "./entry/src/main/ets" hap_profile = "entry/src/main/config.json" ets2abc = true } -ohos_resources("freeinstallstartabilityfatest_ets_resources") { +ohos_resources("actsfreeinstallconnectabilityfatest_ets_resources") { sources = [ "./entry/src/main/resources" ] hap_profile = "./entry/src/main/config.json" } diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/Test.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/Test.json similarity index 92% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/Test.json rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/Test.json index a473fdecb86d9fb6a6a7e26e8c0a3f380c010657..f546b6ba45da983cda3f2c768f4dbadc1971cdd2 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/Test.json +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.example.myapplication.hmservice", "package-name": "com.example.myapplication", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "10000" }, "kits": [ { "test-file-name": [ - "FreeInstallConnectAbilityFaTest.hap" + "ActsFreeInstallConnectAbilityFaTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/config.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/config.json rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/config.json diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/app.ets 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 new file mode 100644 index 0000000000000000000000000000000000000000..71c6c129811f8ca20095f46164677fa274d74231 --- /dev/null +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,46 @@ +// @ts-nocheck +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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"; +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + + 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() { + 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/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets similarity index 99% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets index 5dd86d6ebb8fad9a9578ea6713243d760c5f86fb..6375de628759370602f21c70e52191cd229cb506 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets @@ -15,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +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' diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets similarity index 99% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets index d3232ec906ff4fc9e8c3200ba1ef8992b465f8de..eac3752f2a06de7d4e49d17be6994e8a7fdb7be9 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets @@ -15,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +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' diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/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 similarity index 99% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets index 54120ab10b5a009f18e9c150f7427e78981a06a5..a5300a0f23f4b3368009daa71604380adda86682 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/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 @@ -14,7 +14,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +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'; diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/pages/index.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/pages/index.ets rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/pages/index.ets diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility10/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility10/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility10/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility10/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility11/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility11/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility11/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility11/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility2/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility3/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility3/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility3/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility3/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility4/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility4/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility4/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility4/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility5/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility5/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility5/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility5/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility6/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility6/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility6/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility6/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility7/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility7/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility7/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility7/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility8/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility8/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility8/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility8/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility9/service.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility9/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility9/service.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/ServiceAbility9/service.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 98% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 3134bf3aca18a39ba3111efebcfe082ca2343dfe..d85e64c4e36b63105278fed2300e417530d45802 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -23,7 +23,7 @@ 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 package','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 3efa07583577fab3dd6f797ee79a54a474983d8f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,63 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file'; -import {Core, ExpectExtend, ReportExtend} from "deccjsunit/index.ets"; -import testsuite from "../test/List.test"; -import featureAbility from "@ohos.ability.featureAbility"; -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - aboutToAppear() { - console.info("start run testcase!!!!") - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - console.info('parameters---->' + JSON.stringify(Want.parameters)); - Want.parameters.timeout = 10000; - configService.setConfig(Want.parameters); - testsuite(); - core.execute(); - console.info('Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - 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/freeinstallconnectabilitystagetest/AppScope/app.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/app.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/AppScope/app.json rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/app.json diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/BUILD.gn b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/BUILD.gn similarity index 66% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/BUILD.gn index 0d2ef9be2ff9b7185f6f9668aab1d1a8fa7e1ecc..357cdd42a9af05ebe00a3d87894d4eac1346bef4 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/BUILD.gn @@ -13,29 +13,29 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("FreeInstallStartAbilityStageTest") { +ohos_js_hap_suite("ActsFreeInstallConnectAbilityStageTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ - ":freeinstallstartabilitystagetest_js_assets", - ":freeinstallstartabilitystagetest_resources", + ":actsfreeinstallconnectabilitystagetest_js_assets", + ":actsfreeinstallconnectabilitystagetest_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "FreeInstallStartAbilityStageTest" + hap_name = "ActsFreeInstallConnectAbilityStageTest" } -ohos_app_scope("freeinstallstartabilitystagetest_app_profile") { +ohos_app_scope("actsfreeinstallconnectabilitystagetest_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("freeinstallstartabilitystagetest_js_assets") { +ohos_js_assets("actsfreeinstallconnectabilitystagetest_js_assets") { source_dir = "entry/src/main/ets" } -ohos_resources("freeinstallstartabilitystagetest_resources") { +ohos_resources("actsfreeinstallconnectabilitystagetest_resources") { sources = [ "entry/src/main/resources" ] - deps = [ ":freeinstallstartabilitystagetest_app_profile" ] + deps = [ ":actsfreeinstallconnectabilitystagetest_app_profile" ] hap_profile = "entry/src/main/module.json" } diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/Test.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/Test.json similarity index 92% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/Test.json rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/Test.json index 0a6ab9cd2f995e2db5a19804d3b76951d87eebea..fb80657451240e232a3db02b2579135a3d737a88 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/Test.json +++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.example.myapplication.hmservice", "module-name": "entry", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "60000" }, "kits": [ { "test-file-name": [ - "FreeInstallConnectAbilityStageTest.hap" + "ActsFreeInstallConnectAbilityStageTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility3/ServiceAbility3.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility3/ServiceAbility3.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility3/ServiceAbility3.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility3/ServiceAbility3.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility4/ServiceAbility4.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility4/ServiceAbility4.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility4/ServiceAbility4.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility4/ServiceAbility4.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility5/ServiceAbility5.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility5/ServiceAbility5.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility5/ServiceAbility5.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility5/ServiceAbility5.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility6/ServiceAbility6.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility6/ServiceAbility6.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility6/ServiceAbility6.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility6/ServiceAbility6.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility7/ServiceAbility7.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility7/ServiceAbility7.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility7/ServiceAbility7.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility7/ServiceAbility7.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility8/ServiceAbility8.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility8/ServiceAbility8.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility8/ServiceAbility8.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility8/ServiceAbility8.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility9/ServiceAbility9.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility9/ServiceAbility9.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility9/ServiceAbility9.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/ServiceAbility9/ServiceAbility9.ts diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 97% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index ec20fc0823ea020a5e20468f96d136147dd3a2b8..28b63ae323260a1c50537460cc23308796714f81 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -22,7 +22,7 @@ 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 level', '-s testType', '-s size', '-s timeout','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets similarity index 57% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets index 1c3a4da0ee43f97df122a059f5bff0ad6e86ae93..9f1d4ceb5aeab5ebee551ff485cc741c02601572 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index.ets @@ -14,29 +14,22 @@ */ // @ts-nocheck -import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets" -import List from '../test/ListTest' +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!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - globalThis.abilityWant.parameters.timeout = 60000; - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(globalThis.abilityWant.parameters); - List(globalThis.abilityContext); - core.execute(); + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } build() { diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/pages/index2.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index2.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/pages/index2.ets rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/pages/index2.ets diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets similarity index 99% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets index 8770453e8b42bb31f4ee9f16cfd4c7e56cead323..51f4370a758a52d5d7a824fa1e22ca028d98198e 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest.ets @@ -15,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +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'; diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets similarity index 99% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets index fdcda47764b58703e9153d24752b76187b8bfe71..73353fe6e1467d962b4883be1f906d4c144748ee 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets +++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ConnectAbilityTest_Ext.ets @@ -14,7 +14,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import commonEvent from '@ohos.commonEvent'; export default function ConnectAbilityTest_Ext(abilityContext) { diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ListTest.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/ets/test/ListTest.ets rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/ets/test/ListTest.ets diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/module.json rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/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 similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/resources/base/profile/main_pages.json diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/BUILD.gn similarity index 73% rename from ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/BUILD.gn index d15d2df4219daa703f0f69420f1e8fc001ff23d2..ea23eb9998dad49b339fc9aaea6f93dacacf9033 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/freeinstallconnectabilityfatest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/BUILD.gn @@ -13,22 +13,22 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("FreeInstallConnectAbilityFaTest") { +ohos_js_hap_suite("ActsFreeInstallStartAbilityFaTest") { hap_profile = "./entry/src/main/config.json" deps = [ - ":freeinstallconnectabilityfatest_ets_assets", - ":freeinstallconnectabilityfatest_ets_resources", + ":actsfreeinstallstartabilityfatest_ets_assets", + ":actsfreeinstallstartabilityfatest_ets_resources", ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FreeInstallConnectAbilityFaTest" + hap_name = "ActsFreeInstallStartAbilityFaTest" } -ohos_js_assets("freeinstallconnectabilityfatest_ets_assets") { +ohos_js_assets("actsfreeinstallstartabilityfatest_ets_assets") { source_dir = "./entry/src/main/ets" hap_profile = "entry/src/main/config.json" ets2abc = true } -ohos_resources("freeinstallconnectabilityfatest_ets_resources") { +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/freeinstallstartabilityfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/Test.json similarity index 89% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/Test.json index 49286efd7644c24254bf06aca3ab24cd33ca4e6c..bc361d1e6227f117f7371775fc144881425fbb50 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.open.harmony.startAbility", "package-name": "com.open.harmony.startAbility", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "FreeInstallStartAbilityFaTest.hap" + "ActsFreeInstallStartAbilityFaTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/config.json rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 61% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets index 8800e52414c0cd250b0db931fba3d789f8bd9db3..60d7d89b364c39e6d2b1920c684793bd6f00b6c8 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -17,7 +17,8 @@ import router from '@system.router'; import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend,expect} from "deccjsunit/index"; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' import testsuite from "../test/List.test"; import featureAbility from "@ohos.ability.featureAbility"; @@ -36,29 +37,13 @@ async function routePage() { @Component struct Index { aboutToAppear() { - console.info("start run testcase!!!!") - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - Want.parameters.timeout = 50000; - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - console.info('parameters---->' + JSON.stringify(Want.parameters)); - configService.setConfig(Want.parameters); - testsuite(); - core.execute(); - console.info('Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - }) + 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() { diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/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 similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/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 similarity index 94% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets index f21da957daa2d35375368ecb7c306c7ca589b90e..94a1b7f5e3884bf5a8c9b75d5461d77c4ce1443b 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/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 @@ -14,7 +14,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"; +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'; @@ -543,72 +543,6 @@ export default function startAbilityTest() { done(); }); - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1300 - * @tc.name Flags= '94.31' 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_1300", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1300-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1300"; - let wrong; - var str = { - 'want': { - "bundleName": "com.example.qianyiyingyong.hmservice", - "abilityName": "com.example.qianyiyingyong.MainAbility", - "moduleName": "entry", - "flags": 94.31 - } - } - 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_1300-------------"); - done(); - }); - - /* - * @tc.number FreeInstall_FA_Local_StartAbility_1400 - * @tc.name Flags= '94.31' of incoming error, atomized HAP package installed - * @tc.desc Function test - * @tc.level 0 - */ - it("FreeInstall_FA_Local_StartAbility_1400", 0, async function (done) { - console.info("------------start FreeInstall_FA_Local_StartAbility_1400-------------"); - TAG = "FreeInstall_FA_Local_StartAbility_1400"; - var cmd1400 = "bm install -p data/test/AtomizationFaEntry.hap"; - delegator.executeShellCommand(cmd1400, (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": 94.31 - } - } - 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_1400-------------"); - done(); - }); - /* * @tc.number FreeInstall_FA_Local_StartAbility_1500 * @tc.name Flags= '' of the incoming error. There is a hap package that needs to be diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/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 similarity index 99% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets index eedbb2ed68075a2777e75c60072a1eb7999d2c86..5520cafb598681e15e1865a692ab3625e1010040 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/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 @@ -15,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"; +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' diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/Utils.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/Utils.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/Utils.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/PageAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/PageAbility/app.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/app.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/PageAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/pages/index.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/PageAbility/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/PageAbility/pages/index.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 98% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index f9e8ab66979f59c8109f65c8f2a4f21867fbf44b..06bbc557648940a5153e04c9e584043474ab2a9c 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -23,7 +23,7 @@ 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 package','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/BUILD.gn similarity index 70% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/BUILD.gn index 93e0276d9f4aa1bbf25dc7ed73612e1150e97a0b..57e0a685b85e3039da5048a950b2be8141a1f9a6 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/BUILD.gn @@ -13,20 +13,20 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("StartAbilityNoTargetBundleListFaTest") { +ohos_js_hap_suite("ActsStartAbilityNoTargetBundleListFaTest") { hap_profile = "./entry/src/main/config.json" deps = [ - ":startabilitynotargetbundlelistfatest_ets_assets", - ":startabilitynotargetbundlelistfatest_ets_resources", + ":actsstartabilitynotargetbundlelistfatest_ets_assets", + ":actsstartabilitynotargetbundlelistfatest_ets_resources", ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "StartAbilityNoTargetBundleListFaTest" + hap_name = "ActsStartAbilityNoTargetBundleListFaTest" } -ohos_js_assets("startabilitynotargetbundlelistfatest_ets_assets") { +ohos_js_assets("actsstartabilitynotargetbundlelistfatest_ets_assets") { source_dir = "./entry/src/main/ets/MainAbility" } -ohos_resources("startabilitynotargetbundlelistfatest_ets_resources") { +ohos_resources("actsstartabilitynotargetbundlelistfatest_ets_resources") { sources = [ "./entry/src/main/resources" ] hap_profile = "./entry/src/main/config.json" } diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/Test.json similarity index 87% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/Test.json index 7492f13e4af6dc4a96a3ffb644f201c300b141f4..8942283b10dc138a43019cf479d0bf4676aa8a2e 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.open.harmony.startAbility", "package-name": "com.open.harmony.startAbility", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "StartAbilityNoTargetBundleListFaTest.hap" + "ActsStartAbilityNoTargetBundleListFaTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/config.json rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 61% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets index ea2b35a8c128f57ac266544e7b09a8b8578e5889..b2f7c90c1f99badee175828cce3b78984ddb8aa4 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -17,7 +17,8 @@ import router from '@system.router'; import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend,expect} from "deccjsunit/index"; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' import testsuite from "../test/List.test"; import featureAbility from "@ohos.ability.featureAbility"; @@ -36,29 +37,13 @@ async function routePage() { @Component struct Index { aboutToAppear() { - console.info("start run testcase!!!!") - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - Want.parameters.timeout = 50000; - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - console.info('parameters---->' + JSON.stringify(Want.parameters)); - configService.setConfig(Want.parameters); - testsuite(); - core.execute(); - console.info('Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - }) + 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() { diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/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 similarity index 99% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets index 2c70731d91551d55b06a53b62180b6c0ce070d9d..7b12f12ab40b4f04131c8bd4f025a4284131e11a 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/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 @@ -15,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"; +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'; diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/Utils.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 98% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index f9e8ab66979f59c8109f65c8f2a4f21867fbf44b..06bbc557648940a5153e04c9e584043474ab2a9c 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -23,7 +23,7 @@ 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 package','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn similarity index 69% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn index b3f3f8a5ff3c3781604897540136b84c1ec3b5ba..9903d7a39fbe4eb66bed2cce5a12d7cc68eea54f 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn @@ -13,20 +13,20 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("FreeInstallStartAbilityForResultFaTest") { +ohos_js_hap_suite("ActsFreeInstallStartAbilityForResultFaTest") { hap_profile = "./entry/src/main/config.json" deps = [ - ":freeinstallstartabilityforresultfatest_ets_assets", - ":freeinstallstartabilityforresultfatest_ets_resources", + ":actsfreeinstallstartabilityforresultfatest_ets_assets", + ":actsfreeinstallstartabilityforresultfatest_ets_resources", ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FreeInstallStartAbilityForResultFaTest" + hap_name = "ActsFreeInstallStartAbilityForResultFaTest" } -ohos_js_assets("freeinstallstartabilityforresultfatest_ets_assets") { +ohos_js_assets("actsfreeinstallstartabilityforresultfatest_ets_assets") { source_dir = "./entry/src/main/ets/MainAbility" } -ohos_resources("freeinstallstartabilityforresultfatest_ets_resources") { +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/freeinstallstartabilityforresultfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json similarity index 89% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json index d78670e9c553fa0c3028d9310d1eb8111a6f2096..b7ed08ebb5437bc1b8398a30442d82f9da3e71a1 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.open.harmony.startAbilityForResult", "package-name": "com.open.harmony.startAbilityForResult", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "FreeInstallStartAbilityForResultFaTest.hap" + "ActsFreeInstallStartAbilityForResultFaTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/config.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 61% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets index bfec465ee4537e893285030f9b1113f3b6272376..2fb0fdf90bd41c7ded1e7b863c96947703d0d297 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -17,7 +17,8 @@ import router from '@system.router'; import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend,expect} from "deccjsunit/index"; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' import testsuite from "../test/List.test"; import featureAbility from "@ohos.ability.featureAbility"; @@ -36,29 +37,13 @@ async function routePage() { @Component struct Index { aboutToAppear() { - console.info("start run testcase!!!!") - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - Want.parameters.timeout = 50000; - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - console.info('parameters---->' + JSON.stringify(Want.parameters)); - configService.setConfig(Want.parameters); - testsuite(); - core.execute(); - console.info('Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - }) + 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() { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/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 similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/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 similarity index 99% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets index 660389022af82768af49639c62bd9e58fd1f5cbd..721bc3f77cff4306e122ac3430c1b0b34ca75b5c 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/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 @@ -16,7 +16,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"; +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'; diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/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 similarity index 99% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets index 176ca0d7e692cc4e71f98e5136601d55b332c7f1..589c442c1c8d16eecb5bae91517d674d417383d9 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/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 @@ -16,7 +16,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"; +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'; diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/Utils.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/Utils.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/Utils.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/pages/index.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/pages/index.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 98% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index f9e8ab66979f59c8109f65c8f2a4f21867fbf44b..06bbc557648940a5153e04c9e584043474ab2a9c 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/freeinstallstartabilityfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -23,7 +23,7 @@ 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 package','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/freeinstallstartabilityforresultfatest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/BUILD.gn similarity index 70% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/BUILD.gn index 01e6284e03dbb6b9619971b781abca95b8af0a8c..cb02443e2272482f3dc7fe402c885e5322bd05fb 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/BUILD.gn @@ -13,20 +13,20 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("StartAbilityForResultNoTargetFaTest") { +ohos_js_hap_suite("ActsStartAbilityForResultNoTargetFaTest") { hap_profile = "./entry/src/main/config.json" deps = [ - ":startabilityforresultnotargetfatest_ets_assets", - ":startabilityforresultnotargetfatest_ets_resources", + ":actsstartabilityforresultnotargetfatest_ets_assets", + ":actsstartabilityforresultnotargetfatest_ets_resources", ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "StartAbilityForResultNoTargetFaTest" + hap_name = "ActsStartAbilityForResultNoTargetFaTest" } -ohos_js_assets("startabilityforresultnotargetfatest_ets_assets") { +ohos_js_assets("actsstartabilityforresultnotargetfatest_ets_assets") { source_dir = "./entry/src/main/ets/MainAbility" } -ohos_resources("startabilityforresultnotargetfatest_ets_resources") { +ohos_resources("actsstartabilityforresultnotargetfatest_ets_resources") { sources = [ "./entry/src/main/resources" ] hap_profile = "./entry/src/main/config.json" } diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/Test.json similarity index 87% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/Test.json index 723dee8a530c69145e443e0876597486f36ac2ef..fed0246236522d2eb1f980796a3d4d884034ae84 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.open.harmony.startAbilityForResult", "package-name": "com.open.harmony.startAbilityForResult", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "StartAbilityForResultNoTargetFaTest.hap" + "ActsStartAbilityForResultNoTargetFaTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/config.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 61% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets index a422068c451a77f4a692c79937c7f49c83d1abc4..8d2b19fc51126b4a1da925cab9f31d921d252956 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -17,7 +17,8 @@ import router from '@system.router'; import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend,expect} from "deccjsunit/index"; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' import testsuite from "../test/List.test"; import featureAbility from "@ohos.ability.featureAbility"; @@ -36,29 +37,13 @@ async function routePage() { @Component struct Index { aboutToAppear() { - console.info("start run testcase!!!!") - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - Want.parameters.timeout = 50000; - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - console.info('parameters---->' + JSON.stringify(Want.parameters)); - configService.setConfig(Want.parameters); - testsuite(); - core.execute(); - console.info('Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - }) + 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() { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/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 similarity index 99% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets index fb8422c23cdb7749f176fb52e7418c43abb4c85e..22fcd645c35315ad3119043d6a210c14f7a1c7fe 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/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 @@ -15,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"; +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'; diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/Utils.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 98% rename from ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index f9e8ab66979f59c8109f65c8f2a4f21867fbf44b..06bbc557648940a5153e04c9e584043474ab2a9c 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityfatest/startabilitynotargetbundlelistfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -23,7 +23,7 @@ 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 package','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultfatest/startabilityforresultnotargetfatest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/AppScope/app.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/AppScope/app.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/AppScope/app.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/AppScope/app.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/AppScope/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/AppScope/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/BUILD.gn similarity index 64% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/BUILD.gn index bf71f89abdb435398f7f9192c6ac99c401995246..af7a9fa4dc66a8111ce2e9b0b476810e4961dad9 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/BUILD.gn @@ -13,29 +13,29 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("StartAbilityNoTargetBundleListStageTest") { +ohos_js_hap_suite("ActsFreeInstallStartAbilityForResultStageTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ - ":startabilitynotargetbundleliststagetest_js_assets", - ":startabilitynotargetbundleliststagetest_resources", + ":actsfreeinstallstartabilityforresultstagetest_js_assets", + ":actsfreeinstallstartabilityforresultstagetest_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "StartAbilityNoTargetBundleListStageTest" + hap_name = "ActsFreeInstallStartAbilityForResultStageTest" } -ohos_app_scope("startabilitynotargetbundleliststagetest_app_profile") { +ohos_app_scope("actsfreeinstallstartabilityforresultstagetest_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("startabilitynotargetbundleliststagetest_js_assets") { +ohos_js_assets("actsfreeinstallstartabilityforresultstagetest_js_assets") { source_dir = "entry/src/main/ets" } -ohos_resources("startabilitynotargetbundleliststagetest_resources") { +ohos_resources("actsfreeinstallstartabilityforresultstagetest_resources") { sources = [ "entry/src/main/resources" ] - deps = [ ":startabilitynotargetbundleliststagetest_app_profile" ] + deps = [ ":actsfreeinstallstartabilityforresultstagetest_app_profile" ] hap_profile = "entry/src/main/module.json" } diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/Test.json similarity index 88% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/Test.json index e2cfccad122c9463966476f1d1af1202a9c805cf..678e61d1fd4798a002495bb28af28e857217f25d 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.example.startAbilityForResult.hmservice", "module-name": "entry", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "FreeInstallStartAbilityForResultStageTest.hap" + "ActsFreeInstallStartAbilityForResultStageTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 97% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index ec20fc0823ea020a5e20468f96d136147dd3a2b8..28b63ae323260a1c50537460cc23308796714f81 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -22,7 +22,7 @@ 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 level', '-s testType', '-s size', '-s timeout','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets similarity index 67% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets index fb2b61d0f92f4c740f185c9458ab844f9bbe1842..3826d4124548dc5163ca756f5815d3a841cb790f 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets @@ -15,8 +15,9 @@ */ import router from '@system.router'; import file from '@system.file'; -import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index" -import List from '../test/ListTest' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/ListTest' async function routePage() { let options = { @@ -33,21 +34,13 @@ async function routePage() { @Component struct Index { aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - core.addService('report', reportExtend) - core.init() - globalThis.abilityWant.parameters.timeout = 16000; - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - configService.setConfig(globalThis.abilityWant.parameters); - List(globalThis.abilityContext) - core.execute() + 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() { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/ListTest.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/test/ListTest.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/ListTest.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets similarity index 99% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets index 07f3190e242b20ba3b7497e91a3e9e3f66c4b6d8..bab8df845a87af42654e5e5668861a7ab3ab4548 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets @@ -14,7 +14,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import ability from '@ohos.application.Ability' import rpc from '@ohos.rpc'; import wantConstant from '@ohos.ability.wantConstant' diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/Utils.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/test/Utils.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/Utils.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/module.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/resources/base/profile/main_pages.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/AppScope/app.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/AppScope/app.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/AppScope/app.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/AppScope/app.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/AppScope/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/AppScope/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/BUILD.gn similarity index 61% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/BUILD.gn index b29c1ddbd46a22b3beaaaad1f77643b413289966..1c8af7d242d1c61472677dfc12458d096c1acb9e 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/BUILD.gn @@ -13,29 +13,32 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("StartAbilityForResultNoTargetBundleListStageTest") { +ohos_js_hap_suite("ActsStartAbilityForResultNoTargetBundleListStageTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ - ":startabilityforresultnotargetbundleliststagetest_js_assets", - ":startabilityforresultnotargetbundleliststagetest_resources", + ":actsstartabilityforresultnotargetbundleliststagetest_js_assets", + ":actsstartabilityforresultnotargetbundleliststagetest_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "StartAbilityForResultNoTargetBundleListStageTest" + hap_name = "ActsStartAbilityForResultNoTargetBundleListStageTest" } -ohos_app_scope("startabilityforresultnotargetbundleliststagetest_app_profile") { +ohos_app_scope( + "actsstartabilityforresultnotargetbundleliststagetest_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("startabilityforresultnotargetbundleliststagetest_js_assets") { +ohos_js_assets( + "actsstartabilityforresultnotargetbundleliststagetest_js_assets") { source_dir = "entry/src/main/ets" } -ohos_resources("startabilityforresultnotargetbundleliststagetest_resources") { +ohos_resources( + "actsstartabilityforresultnotargetbundleliststagetest_resources") { sources = [ "entry/src/main/resources" ] - deps = [ ":startabilityforresultnotargetbundleliststagetest_app_profile" ] + deps = [ ":actsstartabilityforresultnotargetbundleliststagetest_app_profile" ] hap_profile = "entry/src/main/module.json" } diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/Test.json similarity index 85% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/Test.json index 0d78cfc0bf0f816073fa6b63e3e4df389f8f4989..83e122a462d7c1a0e788743c3c729f13d61098e2 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.example.startAbilityForResult.hmservice", "module-name": "entry", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "StartAbilityForResultNoTargetBundleListStageTest.hap" + "ActsStartAbilityForResultNoTargetBundleListStageTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 97% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index ec20fc0823ea020a5e20468f96d136147dd3a2b8..28b63ae323260a1c50537460cc23308796714f81 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -22,7 +22,7 @@ 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 level', '-s testType', '-s size', '-s timeout','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets similarity index 69% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets index fb2b61d0f92f4c740f185c9458ab844f9bbe1842..24a6152449c41795122a3f88a2d0d2a8335cfb91 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/pages/index.ets @@ -15,8 +15,9 @@ */ import router from '@system.router'; import file from '@system.file'; -import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index" -import List from '../test/ListTest' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/ListTest' async function routePage() { let options = { @@ -34,20 +35,12 @@ async function routePage() { struct Index { aboutToAppear() { console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - core.addService('report', reportExtend) - core.init() - globalThis.abilityWant.parameters.timeout = 16000; - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - configService.setConfig(globalThis.abilityWant.parameters); - List(globalThis.abilityContext) - core.execute() + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } build() { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets similarity index 99% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets index 45e2430452bdf5a5b6c73f23c4e07a69d67a543f..0854f5d1f36848cd63bbe5717632adf2921eba23 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityForResult.ets @@ -14,7 +14,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import ability from '@ohos.application.Ability' import rpc from '@ohos.rpc'; import wantConstant from '@ohos.ability.wantConstant' diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/Utils.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/Utils.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/Utils.ets rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/ets/test/Utils.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/module.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/AppScope/app.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/AppScope/app.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/AppScope/app.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/AppScope/app.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/AppScope/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/AppScope/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/BUILD.gn similarity index 67% rename from ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/BUILD.gn index 8f9d30d2beee32125c475245eae1d38014b10493..cffb6afdb82904b1cb5fe810c409f23880a68952 100644 --- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/freeinstallconnectabilitystagetest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/BUILD.gn @@ -13,29 +13,29 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("FreeInstallConnectAbilityStageTest") { +ohos_js_hap_suite("ActsFreeInstallStartAbilityStageTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ - ":freeinstallconnectabilitystagetest_js_assets", - ":freeinstallconnectabilitystagetest_resources", + ":actsfreeinstallstartabilitystagetest_js_assets", + ":actsfreeinstallstartabilitystagetest_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "FreeInstallConnectAbilityStageTest" + hap_name = "ActsFreeInstallStartAbilityStageTest" } -ohos_app_scope("freeinstallconnectabilitystagetest_app_profile") { +ohos_app_scope("actsfreeinstallstartabilitystagetest_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("freeinstallconnectabilitystagetest_js_assets") { +ohos_js_assets("actsfreeinstallstartabilitystagetest_js_assets") { source_dir = "entry/src/main/ets" } -ohos_resources("freeinstallconnectabilitystagetest_resources") { +ohos_resources("actsfreeinstallstartabilitystagetest_resources") { sources = [ "entry/src/main/resources" ] - deps = [ ":freeinstallconnectabilitystagetest_app_profile" ] + deps = [ ":actsfreeinstallstartabilitystagetest_app_profile" ] hap_profile = "entry/src/main/module.json" } diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/Test.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/Test.json similarity index 88% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/Test.json index 12e0d2e5a47feebafbfbb88eb13ac173a5ae8dcc..c4ba0ce2696acf8ec60e14f25c52b3988779c395 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.open.harmony.packagemag", "module-name": "entry", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "FreeInstallStartAbilityStageTest.hap" + "ActsFreeInstallStartAbilityStageTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/FormAbility/FormAbility.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/FormAbility/FormAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/FormAbility/FormAbility.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/FormAbility/FormAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/MainAbility1/MainAbility1.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/MainAbility1/MainAbility1.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/MainAbility1/MainAbility1.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/MainAbility1/MainAbility1.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 97% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 2c446f687cce0ed2e023e32461014af624e1ab01..3348d2bc5ca78af8cbb5187128590fb8bee9022e 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -22,7 +22,7 @@ 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 level', '-s testType', '-s size', '-s timeout','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { 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 new file mode 100644 index 0000000000000000000000000000000000000000..cf044dab7bf62aeb0e2f36c5fd1eb19d1126a177 --- /dev/null +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets @@ -0,0 +1,47 @@ +// @ts-nocheck +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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' +import file from '@system.file'; + +@Entry +@Component +struct Index { + @State message: string = 'StartAbilityTest' + 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/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/pages/second.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/ListTest.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/test/ListTest.ets rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/ListTest.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets similarity index 95% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets index 84fcd95027484f4e0a930aecdbbbd602c51270ad..94642e7d33b4313a1cf07b4226dc598f285ad340 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets @@ -16,7 +16,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import ability from '@ohos.application.Ability' import rpc from '@ohos.rpc'; import wantConstant from '@ohos.ability.wantConstant' @@ -158,7 +158,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -189,7 +189,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -224,7 +224,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -259,7 +259,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -289,7 +289,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -327,7 +327,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -366,7 +366,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -407,7 +407,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "hnm2", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -447,7 +447,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str, (error, data) => { + globalThis.abilityContext.startAbility(str, (error, data) => { console.log(TAG + ": startAbility err: " + JSON.stringify(error) + ",data: " + JSON.stringify(data)); expect(error.code == 0).assertTrue(); }) @@ -473,7 +473,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str, (error, data) => { + globalThis.abilityContext.startAbility(str, (error, data) => { console.log(TAG + ": startAbility err: " + JSON.stringify(error) + ",data: " + JSON.stringify(data)); expect(error.code == 0).assertTrue(); }) @@ -500,7 +500,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": 1717, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -534,7 +534,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": 1717, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -564,7 +564,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": '94.31', } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -598,7 +598,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": '94.31', } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -628,7 +628,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": '', } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -662,7 +662,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": '', } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -690,7 +690,7 @@ export default function startAbilityTest(abilityContext) { "abilityName": "com.example.qianyiyingyong.MainAbility", "moduleName": "entry", } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -723,7 +723,7 @@ export default function startAbilityTest(abilityContext) { "abilityName": "com.example.qianyiyingyong.MainAbility", "moduleName": "entry", } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -759,7 +759,7 @@ export default function startAbilityTest(abilityContext) { "site": "很开心看到你!" } } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -795,7 +795,7 @@ export default function startAbilityTest(abilityContext) { "site": "很开心看到你!" } } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -827,7 +827,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -862,7 +862,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -910,7 +910,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -965,7 +965,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "hm4", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -1006,7 +1006,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "hm4", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -1045,7 +1045,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "hnm", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -1073,7 +1073,7 @@ export default function startAbilityTest(abilityContext) { "abilityName": "com.example.qianyiyingyong.MainAbility", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -1107,7 +1107,7 @@ export default function startAbilityTest(abilityContext) { "abilityName": "com.example.qianyiyingyong.MainAbility", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -1135,7 +1135,7 @@ export default function startAbilityTest(abilityContext) { "bundleName": "com.open.harmony.packagemag", "abilityName": "com.open.harmony.packagemag.ServiceAbility", } - abilityContext.startAbility(str).then((data) => { + 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)); @@ -1163,7 +1163,7 @@ export default function startAbilityTest(abilityContext) { "abilityName": "MainAbility1", "moduleName": "entry", } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": Mainability2 startAbility success. data: " + JSON.stringify(data)); }).catch((error) => { console.log(TAG + ": Mainability2 startAbility fail. err: " + JSON.stringify(error)); @@ -1177,7 +1177,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str2).then((data) => { + globalThis.abilityContext.startAbility(str2).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); }).catch((error) => { console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); @@ -1210,7 +1210,7 @@ export default function startAbilityTest(abilityContext) { "abilityName": "MainAbility1", "moduleName": "entry", } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": Mainability2 startAbility success. data: " + JSON.stringify(data)); }).catch((error) => { console.log(TAG + ": Mainability2 startAbility fail. err: " + JSON.stringify(error)); @@ -1224,7 +1224,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str2).then((data) => { + globalThis.abilityContext.startAbility(str2).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); }).catch((error) => { console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error)); diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.css b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.css similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.css rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.css diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.hml b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.hml similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.hml rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.hml diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/js/ServiceAbility/pages/index/index.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/module.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/profile/form_config.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/profile/form_config.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/profile/form_config.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/profile/form_config.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/resources/base/profile/main_pages.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/AppScope/app.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/AppScope/app.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/AppScope/app.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/AppScope/app.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/AppScope/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/AppScope/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/BUILD.gn similarity index 64% rename from ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/BUILD.gn rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/BUILD.gn index 4412327012625c57bd0e6923af73125a938b20d4..8db27b0e86dfc90ff755a41f603c5d657286a187 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/freeinstallstartabilityforresultstagetest/BUILD.gn +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/BUILD.gn @@ -13,29 +13,29 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("FreeInstallStartAbilityForResultStageTest") { +ohos_js_hap_suite("ActsStartAbilityNoTargetBundleListStageTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ - ":freeinstallstartabilityforresultstagetest_js_assets", - ":freeinstallstartabilityforresultstagetest_resources", + ":actsstartabilitynotargetbundleliststagetest_js_assets", + ":actsstartabilitynotargetbundleliststagetest_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "FreeInstallStartAbilityForResultStageTest" + hap_name = "ActsStartAbilityNoTargetBundleListStageTest" } -ohos_app_scope("freeinstallstartabilityforresultstagetest_app_profile") { +ohos_app_scope("actsstartabilitynotargetbundleliststagetest_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("freeinstallstartabilityforresultstagetest_js_assets") { +ohos_js_assets("actsstartabilitynotargetbundleliststagetest_js_assets") { source_dir = "entry/src/main/ets" } -ohos_resources("freeinstallstartabilityforresultstagetest_resources") { +ohos_resources("actsstartabilitynotargetbundleliststagetest_resources") { sources = [ "entry/src/main/resources" ] - deps = [ ":freeinstallstartabilityforresultstagetest_app_profile" ] + deps = [ ":actsstartabilitynotargetbundleliststagetest_app_profile" ] hap_profile = "entry/src/main/module.json" } diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/Test.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/Test.json similarity index 86% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/Test.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/Test.json index 4ea0bccf5471f5a53169ee57eea82a9626e5cbf8..2e9ec90cce8120690d70f4d63c70fa8dad56c46f 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/Test.json @@ -5,12 +5,13 @@ "test-timeout": "600000", "bundle-name": "com.open.harmony.packagemag.hmservice", "module-name": "entry", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": "50000" }, "kits": [ { "test-file-name": [ - "StartAbilityNoTargetBundleListStageTest.hap" + "ActsStartAbilityNoTargetBundleListStageTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 97% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 2c446f687cce0ed2e023e32461014af624e1ab01..3348d2bc5ca78af8cbb5187128590fb8bee9022e 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -22,7 +22,7 @@ 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 level', '-s testType', '-s size', '-s timeout','-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets similarity index 57% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets index 39d608703153cd07de7a2f4418f2da7c5f4e85da..ac8ffd4dac7495a2ce625c0437fc2463fe4e1fc9 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/pages/index.ets @@ -15,9 +15,10 @@ * limitations under the License. */ -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets" +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/ListTest' import file from '@system.file'; -import List from '../test/ListTest' @Entry @Component @@ -25,22 +26,12 @@ struct Index { @State message: string = 'StartAbility NoTargetBundleList Test' aboutToAppear() { console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - globalThis.abilityWant.parameters.timeout = 20000; - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - List(globalThis.abilityContext) - core.execute() + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } build() { diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/ListTest.ets diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets similarity index 97% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets index 804ca44a6c8310c5309007972ea491b0fb73c20f..0885d2aca087546723948b822acf1904f1efe377 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/ets/test/StartAbilityTest.ets @@ -15,7 +15,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import ability from '@ohos.application.Ability' import rpc from '@ohos.rpc'; import wantConstant from '@ohos.ability.wantConstant' @@ -109,7 +109,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -145,7 +145,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "entry", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); @@ -187,7 +187,7 @@ export default function startAbilityTest(abilityContext) { "moduleName": "myapplication1", "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND, } - abilityContext.startAbility(str).then((data) => { + globalThis.abilityContext.startAbility(str).then((data) => { console.log(TAG + ": startAbility success. data: " + JSON.stringify(data)); flag = 1; expect(flag == 1).assertTrue(); diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/module.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/module.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/module.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/resources/base/element/string.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/resources/base/element/string.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/resources/base/profile/main_pages.json diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/freeinstalltest/startabilitystagetest/startabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 51801c99985b09f246a217507ed2ad6633abf253..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/freeinstallstartabilitystagetest/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,56 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets" -import file from '@system.file'; -import List from '../test/ListTest' - -@Entry -@Component -struct Index { - @State message: string = 'StartAbilityTest' - aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - globalThis.abilityWant.parameters.timeout = 50000; - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - List(globalThis.abilityContext) - core.execute() - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/applications/kitframework/BUILD.gn b/applications/kitframework/BUILD.gn index cc46e27c8becfe8f468dde5d28b2c17e63bd74d5..482ad489f11c33896e93ddd926d6b5b8cac13fab 100644 --- a/applications/kitframework/BUILD.gn +++ b/applications/kitframework/BUILD.gn @@ -26,7 +26,7 @@ hctest_suite("ActsKitFwkApiTest") { "//third_party/bounds_checking_function/include/", "//third_party/mbedtls/include/", "//third_party/cJSON/", - "//base/startup/syspara_lite/interfaces/kits/", + "//base/startup/init/interfaces/innerkits/include/syspara", # dir for oem_auth_config.h and oem_auth_result_storage.h "//vendor/kitframework/include/", diff --git a/applications/kitframework_ipcamera/BUILD.gn b/applications/kitframework_ipcamera/BUILD.gn index 50714eff0d995abf311d11bdf5e5456fd4bb073c..37e7e224aef930fb438fdf052a75074230d70171 100644 --- a/applications/kitframework_ipcamera/BUILD.gn +++ b/applications/kitframework_ipcamera/BUILD.gn @@ -9,7 +9,7 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. +# limitations under the License. import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/hap_pack.gni") @@ -24,7 +24,7 @@ executable("ActsKitFwkApiTest") { "//third_party/cJSON", "//third_party/mbedtls/include/", "//third_party/bounds_checking_function/include/", - "//base/startup/syspara_lite/interfaces/kits/", + "//base/startup/init/interfaces/innerkits/include/syspara", # dir for oem_auth_config.h and oem_auth_result_storage.h "//vendor/kitframework/include/", diff --git a/commonlibrary/ets_utils/buffer_lib_standard/src/main/js/test/Buffer.test.js b/commonlibrary/ets_utils/buffer_lib_standard/src/main/js/test/Buffer.test.js index 545ded7786b3e7a84e98e9f42b428664f333a69d..6c12c0ad385767b83f95ed9f673a9036eecce0e3 100644 --- a/commonlibrary/ets_utils/buffer_lib_standard/src/main/js/test/Buffer.test.js +++ b/commonlibrary/ets_utils/buffer_lib_standard/src/main/js/test/Buffer.test.js @@ -28,6 +28,33 @@ describe('BufferTest', function () { expect(buf.length).assertEqual(10); }); + /** + * @tc.name: testAlloc0011 + * @tc.desc: Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled. + * For example: buffer.alloc(10).fill(string); + * @tc.author: liuganlin + */ + it("testAlloc0011", 0, function () { + let encodeArr = ['utf8', 'utf-8', 'ucs2', 'ucs-2', 'ascii', 'latin1', 'binary', + 'utf16le', 'utf-16le', 'base64', 'base64url', 'hex']; + for (const encode of encodeArr) { + let buf = buffer.alloc(10).fill("ab$#", encode); + expect(buf.length).assertEqual(10); + } + }); + + /** + * @tc.name: testAlloc0012 + * @tc.desc: Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled. + * For example: buffer.alloc(10).fill(buffer); + * @tc.author: liuganlin + */ + it("testAlloc0012", 0, function () { + let buf1 = buffer.alloc(10); + let buf = buffer.alloc(10).fill(buf1); + expect(buf.length).assertEqual(10); + }); + /** * @tc.name: testAlloc0013 * @tc.desc: Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled. @@ -39,6 +66,33 @@ describe('BufferTest', function () { expect(buf.length).assertEqual(0); }); + /** + * @tc.name: testAlloc0014 + * @tc.desc: Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled. + * For example: buffer.alloc(0).fill(string, encode); + * @tc.author: liuganlin + */ + it("testAlloc0014", 0, function () { + let encodeArr = ['utf8', 'utf-8', 'ucs2', 'ucs-2', 'ascii', 'latin1', 'binary', + 'utf16le', 'utf-16le', 'base64', 'base64url', 'hex']; + for (const encode of encodeArr) { + let buf = buffer.alloc(0).fill("ab$#", encode); + expect(buf.length).assertEqual(0); + } + }); + + /** + * @tc.name: testAlloc0015 + * @tc.desc: Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled. + * For example: buffer.alloc(0).fill(buffer); + * @tc.author: liuganlin + */ + it("testAlloc0015", 0, function () { + let buf1 = buffer.alloc(10); + let buf = buffer.alloc(0).fill(buf1); + expect(buf.length).assertEqual(0); + }); + /** * @tc.name: testAlloc0016 * @tc.desc: Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled. @@ -76,6 +130,33 @@ describe('BufferTest', function () { expect(buf.length).assertEqual(10); }); + /** + * @tc.name: testAllocUninitializedFromPool0021 + * @tc.desc: Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled. + * For example: buffer.allocUninitializedFromPool(10).fill(string, encode); + * @tc.author: liuganlin + */ + it("testAllocUninitializedFromPool0021", 0, function () { + let encodeArr = ['utf8', 'utf-8', 'ucs2', 'ucs-2', 'ascii', 'latin1', 'binary', + 'utf16le', 'utf-16le', 'base64', 'base64url', 'hex']; + for (const encode of encodeArr) { + let buf = buffer.allocUninitializedFromPool(10).fill("abcd", encode); + expect(buf.length).assertEqual(10); + } + }); + + /** + * @tc.name: testAllocUninitializedFromPool0022 + * @tc.desc: Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled. + * For example: buffer.allocUninitializedFromPool(10).fill(buffer); + * @tc.author: liuganlin + */ + it("testAllocUninitializedFromPool0022", 0, function () { + let buf1 = buffer.allocUninitializedFromPool(10); + let buf = buffer.allocUninitializedFromPool(10).fill(buf1); + expect(buf.length).assertEqual(10); + }); + /** * @tc.name: testAllocUninitializedFromPool0023 * @tc.desc: Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled. @@ -87,6 +168,33 @@ describe('BufferTest', function () { expect(buf.length).assertEqual(0); }); + /** + * @tc.name: testAllocUninitializedFromPool0024 + * @tc.desc: Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled. + * For example: buffer.allocUninitializedFromPool(0).fill(string, encode); + * @tc.author: liuganlin + */ + it("testAllocUninitializedFromPool0024", 0, function () { + let encodeArr = ['utf8', 'utf-8', 'ucs2', 'ucs-2', 'ascii', 'latin1', 'binary', + 'utf16le', 'utf-16le', 'base64', 'base64url', 'hex']; + for (const encode of encodeArr) { + let buf = buffer.allocUninitializedFromPool(0).fill("abcd", encode); + expect(buf.length).assertEqual(0); + } + }); + + /** + * @tc.name: testAllocUninitializedFromPool0025 + * @tc.desc: Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled. + * For example: buffer.allocUninitializedFromPool(10).fill(buffer); + * @tc.author: liuganlin + */ + it("testAllocUninitializedFromPool0025", 0, function () { + let buf1 = buffer.allocUninitializedFromPool(10); + let buf = buffer.allocUninitializedFromPool(0).fill(buf1); + expect(buf.length).assertEqual(0); + }); + /** * @tc.name: testAllocUninitializedFromPool0026 * @tc.desc: Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled. @@ -151,6 +259,24 @@ describe('BufferTest', function () { let byteLen = buffer.byteLength("$&@*%"); expect(byteLen).assertEqual(5); }); + + /** + * @tc.name: testByteLength0032 + * @tc.desc: Returns the byte length of a string when encoded using `encoding`. + * This is not the same as [`String.prototype.length`], which does not account + * for the encoding that is used to convert the string into bytes. + * For example: buffer.byteLength(string, encode); + * @tc.author: liuganlin + */ + it("testByteLength0032", 0, function () { + let encodeArr = ['utf8', 'utf-8', 'ucs2', 'ucs-2', 'ascii', 'latin1', 'binary', + 'utf16le', 'utf-16le', 'base64', 'base64url', 'hex']; + let result = [4, 4, 8, 8, 4, 4, 4, 8, 8, 3, 3, 2]; + for (let i = 0, len = encodeArr.length; i< len; i++) { + let byteLen = buffer.byteLength("abcd", encodeArr[i]); + expect(byteLen).assertEqual(result[i]); + } + }); /** * @tc.name: testByteLength0035 @@ -338,6 +464,24 @@ describe('BufferTest', function () { expect(str).assertEqual("测试$&*"); }); + /** + * @tc.name: testConcat0073 + * @tc.desc: Returns a new `Buffer` which is the result of concatenating + * all the `Buffer`instances in the `list` together. + * For example: let buf1 = buffer.from("123$"); + * let buf2 = buffer.from("*35"); + * let buf = buffer.concat([buf1, buf2]); + * @tc.author: liuganlin + */ + it("testConcat0073", 0, function () { + let buf1 = buffer.from("123$"); + let buf2 = buffer.from("*35"); + let buf3 = buffer.concat([buf1, buf2]); + let buf = buffer.alloc(5).fill(buf3); + let str = buf.toString(); + expect(str).assertEqual("123$*"); + }); + /** * @tc.name: testConcat0075 * @tc.desc: Returns a new `Buffer` which is the result of concatenating @@ -582,6 +726,19 @@ describe('BufferTest', function () { expect(buf.length).assertEqual(0); }); + /** + * @tc.name: testSubarray0139 + * @tc.desc: Returns a new Buffer that references the same memory as the original, + * but offset and cropped by the start and end indices. + * For example: buf1.subarray(6, 9); + * @tc.author: liuganlin + */ + it("testSubarray0139", 0, function () { + let buf1 = buffer.from("1236"); + let buf = buf1.subarray(6, 9); + expect(buf.length).assertEqual(0); + }); + /** * @tc.name: testCopy0140 * @tc.desc: Copies data from a region of buf to a region in target, @@ -600,6 +757,24 @@ describe('BufferTest', function () { expect(str).assertEqual("1236"); }); + /** + * @tc.name: testCopy0141 + * @tc.desc: Copies data from a region of buf to a region in target, + * even if the target memory region overlaps with buf. + * If sourceEnd is greater than the length of the target, the length of the target shall prevail, + * and the extra part will not be overwritten. + * For example: buf1.copy(buf2, targetStart, sourceStart, sourceEnd); + * @tc.author: liuganlin + */ + it("testCopy0141", 0, function () { + let buf1 = buffer.from("abcdefg"); + let buf2 = buffer.from("1235789"); + let num = buf1.copy(buf2, 2, 1, 3); + expect(num).assertEqual(2); + let str = buf2.toString(); + expect(str).assertEqual("12bc789"); + }); + /** * @tc.name: testCopy0143 * @tc.desc: Copies data from a region of buf to a region in target, @@ -780,6 +955,19 @@ describe('BufferTest', function () { expect(index).assertEqual(1); }); + /** + * @tc.name: testIndexOf0171 + * @tc.desc: The index of the first occurrence of value in buf. + * For example: let buf1 = buffer.from("13236"); + * buf1.indexOf("3", 2); + * @tc.author: liuganlin + */ + it("testIndexOf0171", 0, function () { + let buf1 = buffer.from("13236"); + let index = buf1.indexOf("3", 2); + expect(index).assertEqual(3); + }); + /** * @tc.name: testIndexOf0173 * @tc.desc: The index of the first occurrence of value in buf. @@ -804,6 +992,18 @@ describe('BufferTest', function () { expect(index).assertEqual(20); }); + /** + * @tc.name: testIndexOf0175 + * @tc.desc: The index of the first occurrence of value in buf. + * For example: let index = buf1.indexOf(value, byteOffset); + * @tc.author: liuganlin + */ + it("testIndexOf0175", 0, function () { + let buf1 = buffer.from("13236235"); + let index = buf1.indexOf("23", 3); + expect(index).assertEqual(5); + }); + /** * @tc.name: testIndexOf0176 * @tc.desc: The index of the first occurrence of value in buf. @@ -828,6 +1028,18 @@ describe('BufferTest', function () { expect(index).assertEqual(3); }); + /** + * @tc.name: testLastIndexOf0181 + * @tc.desc: The index of the last occurrence of value in buf. + * For example: let buf1 = buffer.from("13236"); buf1.lastIndexOf("3", 2); + * @tc.author: liuganlin + */ + it("testLastIndexOf0181", 0, function () { + let buf1 = buffer.from("13236"); + let index = buf1.lastIndexOf("3", 2); + expect(index).assertEqual(1); + }); + /** * @tc.name: testLastIndexOf0183 * @tc.desc: The index of the last occurrence of value in buf. @@ -840,6 +1052,18 @@ describe('BufferTest', function () { expect(index).assertEqual(5); }); + /** + * @tc.name: testLastIndexOf0184 + * @tc.desc: The index of the last occurrence of value in buf. + * For example: let buf1 = buffer.from("13236235"); buf1.lastIndexOf("23", 3); + * @tc.author: liuganlin + */ + it("testLastIndexOf0184", 0, function () { + let buf1 = buffer.from("13236235"); + let index = buf1.lastIndexOf("23", 3); + expect(index).assertEqual(2); + }); + /** * @tc.name: testLastIndexOf0186 * @tc.desc: The index of the last occurrence of value in buf. @@ -864,6 +1088,18 @@ describe('BufferTest', function () { expect(flag).assertEqual(true); }); + /** + * @tc.name: testIncludes0191 + * @tc.desc: Returns true if value was found in buf, false otherwise. + * For example: let buf1 = buffer.from("13236"); buf1.includes("3", 2); + * @tc.author: liuganlin + */ + it("testIncludes0191", 0, function () { + let buf1 = buffer.from("13236"); + let flag = buf1.includes("3", 2); + expect(flag).assertEqual(true); + }); + /** * @tc.name: testIncludes0193 * @tc.desc: Returns true if value was found in buf, false otherwise. @@ -876,6 +1112,18 @@ describe('BufferTest', function () { expect(flag).assertEqual(true); }); + /** + * @tc.name: testIncludes0194 + * @tc.desc: Returns true if value was found in buf, false otherwise. + * For example: let buf1 = buffer.from("13236"); buf1.includes("32", 2); + * @tc.author: liuganlin + */ + it("testIncludes0194", 0, function () { + let buf1 = buffer.from("13236"); + let flag = buf1.includes("32", 2); + expect(flag).assertEqual(false); + }); + /** * @tc.name: testIncludes0194 * @tc.desc: Returns true if value was found in buf, false otherwise. @@ -1401,6 +1649,23 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteInt32BE0313 + * @tc.desc: Writes value to buf at the specified offset as big-endian. + * The value must be a valid signed 32-bit integer. + * For example: let ref = buf.writeInt32BE(0x12345678, 1); + * @tc.author: liuganlin + */ + it("testWriteInt32BE0313", 0, function () { + let buf = buffer.alloc(4); + try { + let ref = buf.writeInt32BE(0x12345678, 1); + } catch (err) { + expect(err.name).assertEqual('RangeError'); + expect(err.message).assertEqual('The value of "offset" is out of range'); + } + }); + /** * @tc.name: testWriteInt32LE0320 * @tc.desc: Writes value to buf at the specified offset as little-endian. @@ -1419,7 +1684,7 @@ describe('BufferTest', function () { * @tc.name: testWriteInt32LE0321 * @tc.desc: Writes value to buf at the specified offset as little-endian. * The value must be a valid signed 32-bit integer. - * For example: let ref = buf.writeInt32LE(0x12345678, 0); + * For example: let ref = buf.writeInt32LE(0x12345678, -1); * @tc.author: liuganlin */ it("testWriteInt32LE0321", 0, function () { @@ -1449,6 +1714,23 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteInt32LE0323 + * @tc.desc: Writes value to buf at the specified offset as little-endian. + * The value must be a valid signed 32-bit integer. + * For example: let ref = buf.writeInt32LE(0x12345678, 1); + * @tc.author: liuganlin + */ + it("testWriteInt32LE0323", 0, function () { + let buf = buffer.alloc(4); + try { + let ref = buf.writeInt32LE(0x12345678, 1); + } catch (err) { + expect(err.name).assertEqual('RangeError'); + expect(err.message).assertEqual('The value of "offset" is out of range'); + } + }); + /** * @tc.name: testWriteInt16BE0330 * @tc.desc: Writes value to buf at the specified offset as big-endian. @@ -1496,6 +1778,23 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteInt16BE0333 + * @tc.desc: Writes value to buf at the specified offset as big-endian. + * The value must be a valid signed 16-bit integer. + * For example: + * @tc.author: liuganlin + */ + it("testWriteInt16BE0333", 0, function () { + let buf = buffer.alloc(2); + try { + let ref = buf.writeInt16BE(0x7bca, 1); + } catch (err) { + expect(err.name).assertEqual('RangeError'); + expect(err.message).assertEqual('The value of "offset" is out of range'); + } + }); + /** * @tc.name: testWriteInt16LE0340 * @tc.desc: Writes value to buf at the specified offset as little-endian. @@ -1544,6 +1843,23 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteInt16LE0343 + * @tc.desc: Writes value to buf at the specified offset as little-endian. + * The value must be a valid signed 16-bit integer. + * For example: + * @tc.author: liuganlin + */ + it("testWriteInt16LE0343", 0, function () { + let buf = buffer.alloc(2); + try { + let ref = buf.writeInt16LE(0x1234, 1); + } catch (err) { + expect(err.name).assertEqual('RangeError'); + expect(err.message).assertEqual('The value of "offset" is out of range'); + } + }); + /** * @tc.name: testWriteInt80350 * @tc.desc: Writes value to buf at the specified offset. @@ -1590,6 +1906,18 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteInt80353 + * @tc.desc: Writes value to buf at the specified offset.value must be a valid signed 8-bit integer. + * For example: + * @tc.author: liuganlin + */ + it("testWriteInt80353", 0, function () { + let buf = buffer.allocUninitializedFromPool(2); + let ref = buf.writeInt8(0x2, 1); + expect(ref).assertEqual(2); + }); + /** * @tc.name: testWriteUInt16BE0360 * @tc.desc: Writes value to buf at the specified offset as big-endian. @@ -1607,7 +1935,7 @@ describe('BufferTest', function () { * @tc.name: testWriteUInt16BE0361 * @tc.desc: Writes value to buf at the specified offset as big-endian. * The value must be a valid unsigned 16-bit integer. - * For example: + * For example: let ref = buf.writeUInt16BE(0xdeadfc, 0); * @tc.author: liuganlin */ it("testWriteUInt16BE0361", 0, function () { @@ -1624,7 +1952,7 @@ describe('BufferTest', function () { * @tc.name: testWriteUInt16BE0362 * @tc.desc: Writes value to buf at the specified offset as big-endian. * The value must be a valid unsigned 16-bit integer. - * For example: + * For example: let ref = buf.writeUInt16BE(0xdead, -1); * @tc.author: liuganlin */ it("testWriteUInt16BE0362", 0, function () { @@ -1637,6 +1965,19 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteUInt16BE0363 + * @tc.desc: Writes value to buf at the specified offset as big-endian. + * The value must be a valid unsigned 16-bit integer. + * For example: let ref = buf.writeUInt16LE(0xdead, 1); + * @tc.author: liuganlin + */ + it("testWriteUInt16BE0363", 0, function () { + let buf = buffer.allocUninitializedFromPool(4); + let ref = buf.writeUInt16BE(0xdead, 1); + expect(ref).assertEqual(3); + }); + /** * @tc.name: testWriteUInt16LE0370 * @tc.desc: Writes value to buf at the specified offset as little-endian. @@ -1684,6 +2025,19 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteUInt16LE0373 + * @tc.desc: Writes value to buf at the specified offset as little-endian. + * The value must be a valid unsigned 16-bit integer. + * For example: let ref = buf.writeUInt16LE(0xdead, 0); + * @tc.author: liuganlin + */ + it("testWriteUInt16LE0373", 0, function () { + let buf = buffer.allocUninitializedFromPool(4); + let ref = buf.writeUInt16LE(0xdead, 1); + expect(ref).assertEqual(3); + }); + /** * @tc.name: testWriteUInt32BE0380 * @tc.desc: Writes value to buf at the specified offset as big-endian. @@ -1714,6 +2068,23 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteUInt32BE0382 + * @tc.desc: Writes value to buf at the specified offset as big-endian. + * The value must be a valid unsigned 32-bit integer. + * For example: let ref = buf.writeUInt32BE(0xfeedface, 1); + * @tc.author: liuganlin + */ + it("testWriteUInt32BE0382", 0, function () { + let buf = buffer.allocUninitializedFromPool(4); + try { + let ref = buf.writeUInt32BE(0xfeedface, 1); + } catch (err) { + expect(err.name).assertEqual('RangeError'); + expect(err.message).assertEqual('The value of "offset" is out of range'); + } + }); + /** * @tc.name: testWriteUInt32LE0390 * @tc.desc: Writes value to buf at the specified offset as little-endian. @@ -1744,6 +2115,23 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteUInt32LE0392 + * @tc.desc: Writes value to buf at the specified offset as little-endian. + * The value must be a valid unsigned 32-bit integer. + * For example: let ref = buf.writeUInt32LE(0xfeedface, 1); + * @tc.author: liuganlin + */ + it("testWriteUInt32LE0392", 0, function () { + let buf = buffer.allocUninitializedFromPool(4); + try { + let ref = buf.writeUInt32LE(0xfeedface, 1); + } catch (err) { + expect(err.name).assertEqual('RangeError'); + expect(err.message).assertEqual('The value of "offset" is out of range'); + } + }); + /** * @tc.name: testWriteUInt80400 * @tc.desc: Writes value to buf at the specified offset. value must be a valid unsigned 8-bit integer. @@ -1759,7 +2147,7 @@ describe('BufferTest', function () { /** * @tc.name: testWriteUInt80401 * @tc.desc: Writes value to buf at the specified offset. value must be a valid unsigned 8-bit integer. - * For example: let ref = buf.writeUInt8(0x42, 3); + * For example: let ref = buf.writeUInt8(0x42, -1); * @tc.author: liuganlin */ it("testWriteUInt80401", 0, function () { @@ -1772,6 +2160,18 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteUInt80402 + * @tc.desc: Writes value to buf at the specified offset. value must be a valid unsigned 8-bit integer. + * For example: let ref = buf.writeUInt8(0x42, 1); + * @tc.author: liuganlin + */ + it("testWriteUInt80402", 0, function () { + let buf = buffer.allocUninitializedFromPool(4); + let ref = buf.writeUInt8(0x42, 1); + expect(ref).assertEqual(2); + }); + /** * @tc.name: testWriteUIntBE0410 * @tc.desc: Writes byteLength bytes of value to buf at the specified offset as big-endian. @@ -1860,6 +2260,18 @@ describe('BufferTest', function () { } }); + /** + * @tc.name: testWriteUIntLE0423 + * @tc.desc: Writes byteLength bytes of value to buf at the specified offset as little-endian. + * For example: + * @tc.author: liuganlin + */ + it("testWriteUIntLE0423", 0, function () { + let buf = buffer.allocUninitializedFromPool(5); + let ref = buf.writeUIntLE(0x13141516, 1, 4); + expect(ref).assertEqual(5); + }); + /** * @tc.name: testWriteIntBE0430 * @tc.desc: Writes byteLength bytes of value to buf at the specified offset as big-endian. diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js index 604725adbcc7e2fbb3738bc8d6a176e0c245a48c..a7c09b429126316418caf3cd14136e4d0055d8d2 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCall.test.js @@ -16,10 +16,6 @@ import audio from '@ohos.multimedia.audio'; import fileio from '@ohos.fileio'; -import ability_featureAbility from '@ohos.ability.featureAbility'; -import app from '@system.app'; -import bundle from '@ohos.bundle'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import featureAbility from '@ohos.ability.featureAbility' import resourceManager from '@ohos.resourceManager'; @@ -36,12 +32,7 @@ describe('audioCall', function () { const audioManager = audio.getAudioManager(); console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework'); - const audioManagerRec = audio.getAudioManager(); - console.info('AudioFrameworkRecLog: Create AudioManger Object JS Framework'); - - beforeAll(async function () { - await applyPermission(); console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); //mediaDir = '/data/storage/el2/base/haps/entry/cache'; }) @@ -106,36 +97,6 @@ describe('audioCall', function () { }); } - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('AudioFrameworkRenderLog:[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - } else { - console.info('AudioFrameworkRenderLog:[permission] case apply permission failed, createAtManager failed'); - } - } - - async function playbackPromise(AudioRendererOptions, pathName, AudioScene) { resultFlagRen = 'new'; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); @@ -506,7 +467,7 @@ describe('audioCall', function () { rendererInfo: AudioRendererInfo } await getAbilityInfo("capture_js-44100-2C-16B-2.pcm"); - recPromise(AudioCapturerOptions, mediaDir, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + await recPromise(AudioCapturerOptions, mediaDir, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(500); readpath = 'StarWars10s-1C-44100-2SW.wav'; await getFdRead(readpath, done); diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturer.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturer.test.js index fedd8dfa9c6447fb832d17606b79979bcc481f6d..f2c753ad08a19fbe91bf2fc3be958ffc69ef26da 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturer.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturer.test.js @@ -23,31 +23,24 @@ describe('audioCapturer', function () { var audioCapCallBack; var audioCapPromise; var dirPath; - var fpath; - async function getAbilityInfo(fileName) { + async function getFd(fileName) { let context = await featureAbility.getContext(); - console.info("case0 context is " + context); await context.getFilesDir().then((data) => { - console.info("case1 getFilesDir is path " + data); - fpath = data + '/' + fileName; - console.info('case2 fpath is ' + fpath); - }) - } - async function getInfo(fileName) { - let context = await featureAbility.getContext(); - console.info("case0 context is " + context); - await context.getFilesDir().then((data) => { - console.info("case1 getFilesDir is path " + data); dirPath = data + '/' + fileName; - console.info('case2 fpath is ' + dirPath); + console.info('case2 dirPath is ' + dirPath); }) } - const audioManager = audio.getAudioManager(); - console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework'); - + async function closeFileDescriptor() { + await resourceManager.getResourceManager().then(async (mgr) => { + await mgr.closeRawFileDescriptor(dirPath).then(value => { + console.log('AudioFrameworkRenderLog:case closeRawFileDescriptor success for file:' + dirPath); + }).catch(error => { + console.log('AudioFrameworkRenderLog:case closeRawFileDescriptor err: ' + error); + }); + }); + } const audioManagerRec = audio.getAudioManager(); console.info('AudioFrameworkRecLog: Create AudioManger Object JS Framework'); - beforeAll(async function () { console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); await sleep(100); @@ -61,6 +54,7 @@ describe('audioCapturer', function () { afterEach(function () { console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions'); + closeFileDescriptor(); }) afterAll(async function () { @@ -73,7 +67,7 @@ describe('audioCapturer', function () { } - async function recPromise(AudioCapturerOptions, fpath, AudioScene) { + async function recPromise(AudioCapturerOptions, dirPath, AudioScene) { var resultFlag = 'new'; console.info('AudioFrameworkRecLog: Promise : Audio Recording Function'); @@ -100,7 +94,7 @@ describe('audioCapturer', function () { return resultFlag; } - console.info('AudioFrameworkRecLog: AudioCapturer : Path : ' + fpath); + console.info('AudioFrameworkRecLog: AudioCapturer : Path : ' + dirPath); console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); @@ -160,7 +154,7 @@ describe('audioCapturer', function () { var bufferSize = await audioCap.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } @@ -170,7 +164,7 @@ describe('audioCapturer', function () { return resultFlag; } - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } @@ -219,7 +213,7 @@ describe('audioCapturer', function () { } - async function recCallBack(AudioCapturerOptions, fpath, AudioScene) { + async function recCallBack(AudioCapturerOptions, dirPath, AudioScene) { var resultFlag = true; console.info('AudioFrameworkRecLog: CallBack : Audio Recording Function'); @@ -288,7 +282,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -297,7 +291,7 @@ describe('audioCapturer', function () { return resultFlag; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -1032,7 +1026,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_010', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -1079,7 +1073,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -1087,7 +1081,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -1745,7 +1739,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_PROMISE_READ_BUFFER_020', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkpromisereadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkpromisereadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -1791,7 +1785,7 @@ describe('audioCapturer', function () { stateFlag = true; console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -1799,7 +1793,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -1868,7 +1862,7 @@ describe('audioCapturer', function () { capturerInfo: AudioCapturerInfo } - await getInfo("capture_CB_js-44100-2C-16B.pcm"); + await getFd("capture_CB_js-44100-2C-16B.pcm"); var resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(1000); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -1903,7 +1897,7 @@ describe('audioCapturer', function () { capturerInfo: AudioCapturerInfo } - await getInfo("capture_CB_js-44100-2C-16B.pcm"); + await getFd("capture_CB_js-44100-2C-16B.pcm"); var resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(1000); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -1940,7 +1934,7 @@ describe('audioCapturer', function () { capturerInfo: AudioCapturerInfo } - await getInfo("capture_js-44100-2C-16B.pcm"); + await getFd("capture_js-44100-2C-16B.pcm"); var resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -1979,7 +1973,7 @@ describe('audioCapturer', function () { capturerInfo: AudioCapturerInfo } - await getInfo("capture_js-44100-2C-16B.pcm"); + await getFd("capture_js-44100-2C-16B.pcm"); var resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2014,7 +2008,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo44100, } - await getInfo("capture_js-44100-1C-16LE.pcm"); + await getFd("capture_js-44100-1C-16LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2049,7 +2043,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo44100, } - await getInfo("capture_js-44100-1C-16LE.pcm"); + await getFd("capture_js-44100-1C-16LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2084,7 +2078,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo96000, } - await getInfo("capture_js-96000-1C-S24LE.pcm"); + await getFd("capture_js-96000-1C-S24LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2118,7 +2112,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo96000, } - await getInfo("capture_js-96000-1C-S24LE.pcm"); + await getFd("capture_js-96000-1C-S24LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2152,7 +2146,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo48000, } - await getInfo("capture_js-48000-2C-1S32LE.pcm"); + await getFd("capture_js-48000-2C-1S32LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2186,7 +2180,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo48000, } - await getInfo("capture_js-48000-2C-1S32LE.pcm"); + await getFd("capture_js-48000-2C-1S32LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2220,7 +2214,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo8000, } - await getInfo("capture_js-8000-1C-8B.pcm"); + await getFd("capture_js-8000-1C-8B.pcm"); var resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2254,7 +2248,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo8000, } - await getInfo("capture_js-8000-1C-8B.pcm"); + await getFd("capture_js-8000-1C-8B.pcm"); var resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2288,7 +2282,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo11025, } - await getInfo("capture_js-11025-2C-16B.pcm"); + await getFd("capture_js-11025-2C-16B.pcm"); var resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2322,7 +2316,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo11025, } - await getInfo("capture_js-11025-2C-16B.pcm"); + await getFd("capture_js-11025-2C-16B.pcm"); var resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2357,7 +2351,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo12000, } - await getInfo("capture_js-12000-1C-24B.pcm"); + await getFd("capture_js-12000-1C-24B.pcm"); var resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2391,7 +2385,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo12000, } - await getInfo("capture_js-12000-1C-24B.pcm"); + await getFd("capture_js-12000-1C-24B.pcm"); var resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2425,7 +2419,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo16000, } - await getInfo("capture_js-16000-2C-32B.pcm"); + await getFd("capture_js-16000-2C-32B.pcm"); var resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2459,7 +2453,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo16000, } - await getInfo("capture_js-16000-2C-32B.pcm"); + await getFd("capture_js-16000-2C-32B.pcm"); var resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2493,7 +2487,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo22050, } - await getInfo("capture_js-22050-1C-8B.pcm"); + await getFd("capture_js-22050-1C-8B.pcm"); var resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2527,7 +2521,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo22050, } - await getInfo("capture_js-22050-1C-8B.pcm"); + await getFd("capture_js-22050-1C-8B.pcm"); var resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2562,7 +2556,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo24000, } - await getInfo("capture_js-24000-2C-16B.pcm"); + await getFd("capture_js-24000-2C-16B.pcm"); var resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2597,7 +2591,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo24000, } - await getInfo("capture_js-24000-2C-16B.pcm"); + await getFd("capture_js-24000-2C-16B.pcm"); var resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2632,7 +2626,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo32000, } - await getInfo("capture_js-32000-1C-24B.pcm"); + await getFd("capture_js-32000-1C-24B.pcm"); var resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2667,7 +2661,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo32000, } - await getInfo("capture_js-32000-1C-24B.pcm"); + await getFd("capture_js-32000-1C-24B.pcm"); var resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2706,7 +2700,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo64000, } - await getInfo("capture_js-64000-2C-32B.pcm"); + await getFd("capture_js-64000-2C-32B.pcm"); var resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2743,7 +2737,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo64000, } - await getInfo("capture_js-64000-2C-32B.pcm"); + await getFd("capture_js-64000-2C-32B.pcm"); var resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); @@ -2779,7 +2773,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo44100, } - await getInfo("capture_js-44100-1C-16LE.pcm"); + await getFd("capture_js-44100-1C-16LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(100); @@ -2815,7 +2809,7 @@ describe('audioCapturer', function () { capturerInfo: audioCapturerInfo44100, } - await getInfo("capture_js-44100-1C-16LE.pcm"); + await getFd("capture_js-44100-1C-16LE.pcm"); var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, 0); await sleep(100); @@ -2837,7 +2831,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_START_055', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -2936,7 +2930,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_READ_WRITE_056', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -2994,7 +2988,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -3002,7 +2996,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -3087,7 +3081,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_STOP_057', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -3145,7 +3139,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -3153,7 +3147,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -4585,7 +4579,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_5000_REACH_075', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -4644,7 +4638,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -4652,7 +4646,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -4723,7 +4717,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_1000_REACH_076', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -4782,7 +4776,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -4790,7 +4784,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -4855,7 +4849,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_10000_REACH_077', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -4914,7 +4908,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -4922,7 +4916,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -4988,7 +4982,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_100_REACH_078', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -5047,7 +5041,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5055,7 +5049,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -5121,7 +5115,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_1_REACH_079', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -5180,7 +5174,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5188,7 +5182,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -5255,7 +5249,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_0_REACH_080', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -5314,7 +5308,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5322,7 +5316,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -5389,7 +5383,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_LARGEVALUE_REACH_081', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -5448,7 +5442,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5456,7 +5450,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -5522,7 +5516,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_NEGATIVEVALUE_REACH_082', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -5581,7 +5575,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5589,7 +5583,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -5655,7 +5649,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1000_084', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -5712,7 +5706,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5720,7 +5714,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -5810,7 +5804,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1_085', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -5867,7 +5861,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5875,7 +5869,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -5965,7 +5959,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_NEGATIVE_086', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -6022,7 +6016,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -6030,7 +6024,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { @@ -6121,7 +6115,7 @@ describe('audioCapturer', function () { it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_223750_087', 0, async function (done) { var stateFlag; - await getAbilityInfo("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); var AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -6178,7 +6172,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(fpath, 0o102, 0o777); + var fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -6186,7 +6180,7 @@ describe('audioCapturer', function () { stateFlag = false; } console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(fpath, 0o2002, 0o666); + fd = fileio.openSync(dirPath, 0o2002, 0o666); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); } else { diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js index a15978591243fe196db270c5fff98d19d6b27833..a161d04d5b51e63fdd904c537d6651ba89a06e55 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioCapturerChangeInfo.test.js @@ -14,12 +14,9 @@ */ import audio from '@ohos.multimedia.audio'; -import fileio from '@ohos.fileio'; - import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; describe('audioCapturerChange', function () { - var audioCapCallBack; var audioStreamManager; var audioStreamManagerCB; var dirPath; diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js index b468fc066f00569dd603dff24aff2702d790b9ed..39515598ec643bc645787d88e9da92c3aa83dfc6 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioEventManagement.test.js @@ -14,8 +14,6 @@ */ import audio from '@ohos.multimedia.audio'; -import fileio from '@ohos.fileio'; - import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; describe('audioEM', function () { @@ -23,16 +21,6 @@ describe('audioEM', function () { const audioManager = audio.getAudioManager(); var deviceRoleValue = null; var deviceTypeValue = null; - var volErrorMesg = 'Error, Operation not supported or Failed'; - var audioMedia = 3; - var audioRingtone = 2; - var minVol = 0; - var maxVol = 15; - var lowVol = 5; - var highVol = 14; - var outOfRangeVol = 28; - var longValue = '28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843'; - function sleep (ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -763,7 +751,6 @@ describe('audioEM', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_DeviceType_001', 0, async function (done) { - expect(audio.DeviceType.INVALID).assertEqual(0); await sleep(50); done(); @@ -777,8 +764,7 @@ describe('audioEM', function () { * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_AUDIO_MANAGER_DeviceType_001', 0, async function (done) { - + it('SUB_AUDIO_MANAGER_DeviceType_002', 0, async function (done) { expect(audio.DeviceType.WIRED_HEADSET).assertEqual(3); await sleep(50); done(); diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js index 67e80b6274a739caac4b77cdfeb7cde40426719e..a5233058fd93736e4cb623abeb62575c6028b2ea 100755 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js @@ -29,7 +29,6 @@ describe('audioManager', function () { var sRate = null; var cCount = null; var cMask = null; - var volErrorMesg = 'Error, Operation not supported or Failed'; var audioMedia = 3; var audioRingtone = 2; var minVol = 0; @@ -2462,22 +2461,43 @@ describe('audioManager', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_006 - * @tc.name : mute - Media - callback - * @tc.desc : mute - Media - callback - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_006 + * @tc.name : mute - Media - callback + * @tc.desc : mute - Media - callback - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ it('SUB_AUDIO_MANAGER_mute_006', 0, async function (done) { - audioManager.mute(audioMedia, false, (err) => { + await audioManager.setVolume(audioMedia, highVol); + await audioManager.mute(audioMedia, true, (err) => { + if (err) { + console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + expect(false).assertTrue(); + } + console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + }); + await audioManager.mute(audioMedia, false, async (err) => { if (err) { console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : FALSE'); - audioManager.isMute(audioMedia, (err, data) => { + await audioManager.getVolume(audioMedia, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == highVol) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audioMedia, (err, data) => { if (err) { console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); @@ -2506,9 +2526,26 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_005', 0, async function (done) { - await audioManager.mute(audioMedia, false).then(function () { + await audioManager.setVolume(audioMedia, lowVol); + await audioManager.mute(audioMedia, true).then(() => { + console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Media: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + await audioManager.mute(audioMedia, false).then(async function () { console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: FALSE'); - audioManager.isMute(audioMedia).then(function (data) { + await audioManager.getVolume(audioMedia).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == lowVol) { + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audioMedia).then(function (data) { if (data == false) { console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:' + data); expect(true).assertTrue(); @@ -2517,7 +2554,11 @@ describe('audioManager', function () { console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: FAIL: ' + data); expect(false).assertTrue(); } - }); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Media: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); }).catch((err) => { console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: ERROR:' + err.message); expect(false).assertTrue(); @@ -2534,24 +2575,45 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_008', 0, async function (done) { - audioManager.mute(audioRingtone, false, (err) => { + await audioManager.setVolume(audioRingtone, highVol); + await audioManager.mute(audioRingtone, true, (err) => { + if (err) { + console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + expect(false).assertTrue(); + } + console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + }); + await audioManager.mute(audioRingtone, false, async (err) => { if (err) { console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : FALSE'); - audioManager.isMute(audioRingtone, (err, data) => { + await audioManager.getVolume(audioRingtone, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == highVol) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audioRingtone, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: PASS: ' + data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: FAIL: ' + data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data); expect(false).assertTrue(); } done(); @@ -2570,9 +2632,26 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_007', 0, async function (done) { - await audioManager.mute(audioRingtone, false).then(function () { + await audioManager.setVolume(audioRingtone, lowVol); + await audioManager.mute(audioRingtone, true).then(() => { + console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + await audioManager.mute(audioRingtone, false).then(async function () { console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: FALSE'); - audioManager.isMute(audioRingtone).then(function (data) { + await audioManager.getVolume(audioRingtone).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == lowVol) { + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audioRingtone).then(function (data) { if (data == false) { console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: PASS:' + data); expect(true).assertTrue(); @@ -2581,9 +2660,13 @@ describe('audioManager', function () { console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: FAIL: ' + data); expect(false).assertTrue(); } - }); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Ringtone: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Rington: FALSE: ERROR:' + err.message); + console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: ERROR:' + err.message); expect(false).assertTrue(); }); done(); @@ -2598,24 +2681,45 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_015', 0, async function (done) { - audioManager.mute(audio.AudioVolumeType.MEDIA, false, (err) => { + await audioManager.setVolume(audio.AudioVolumeType.MEDIA, highVol); + await audioManager.mute(audio.AudioVolumeType.MEDIA, true, (err) => { + if (err) { + console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + expect(false).assertTrue(); + } + console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + }); + await audioManager.mute(audio.AudioVolumeType.MEDIA, false, async (err) => { if (err) { console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); - expect().assertFail(); + expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Callback : FALSE'); - audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, data) => { + await audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == highVol) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Media : ENAME: failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: PASS: ' + data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: FAIL: ' + data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data); expect(false).assertTrue(); } done(); @@ -2634,20 +2738,41 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_011', 0, async function (done) { - await audioManager.mute(audio.AudioVolumeType.MEDIA, false).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE'); - audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) { - if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:' + data); + await audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); + await audioManager.mute(audio.AudioVolumeType.MEDIA, true).then(() => { + console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Media: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + await audioManager.mute(audio.AudioVolumeType.MEDIA, false).then(async function () { + console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: FALSE'); + await audioManager.getVolume(audio.AudioVolumeType.MEDIA).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == lowVol) { expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: ' + data); expect(false).assertTrue(); } }); + await audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) { + if (data == false) { + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: FAIL: ' + data); + expect(false).assertTrue(); + } + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Media: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); + console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: ERROR:' + err.message); expect(false).assertTrue(); }); done(); @@ -2662,24 +2787,45 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_016', 0, async function (done) { - audioManager.mute(audio.AudioVolumeType.RINGTONE, false, (err) => { + await audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); + await audioManager.mute(audio.AudioVolumeType.RINGTONE, true, (err) => { + if (err) { + console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + expect(false).assertTrue(); + } + console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + }); + await audioManager.mute(audio.AudioVolumeType.RINGTONE, false, async (err) => { if (err) { console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); - expect().assertFail(); + expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: ENAME: Callback : FALSE'); - audioManager.isMute(audio.AudioVolumeType.RINGTONE, (err, data) => { + await audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : ENAME: failed to get Mute Status ${err.message}`); + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == highVol) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audio.AudioVolumeType.RINGTONE, (err, data) => { + if (err) { + console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: ' + data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: FAIL: ' + data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data); expect(false).assertTrue(); } done(); @@ -2690,28 +2836,261 @@ describe('audioManager', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_014 - * @tc.name : mute - Media - Promise - ENAME: - * @tc.desc : mute - Media - Promise - Disable mute + * @tc.number : SUB_AUDIO_MANAGER_mute_014 + * @tc.name : mute - RINGTONE - Promise - ENAME: + * @tc.desc : mute - RINGTONE - Promise - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_014', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.RINGTONE, lowVol); + await audioManager.mute(audio.AudioVolumeType.RINGTONE, true).then(() => { + console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Ringtone: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + await audioManager.mute(audio.AudioVolumeType.RINGTONE, false).then(async function () { + console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: FALSE'); + await audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == lowVol) { + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audio.AudioVolumeType.RINGTONE).then(function (data) { + if (data == false) { + console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: PASS:' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: FAIL: ' + data); + expect(false).assertTrue(); + } + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Ringtone: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + }).catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_021 + * @tc.name : mute - VOICE_CALL - callback - ENAME + * @tc.desc : mute - VOICE_CALL - callback - Disable mute * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_AUDIO_MANAGER_mute_014', 0, async function (done) { - await audioManager.mute(audio.AudioVolumeType.MEDIA, false).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE'); - audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) { + it('SUB_AUDIO_MANAGER_mute_021', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, highVol); + await audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true, (err) => { + if (err) { + console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + expect(false).assertTrue(); + } + console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + }); + await audioManager.mute(audio.AudioVolumeType.VOICE_CALL, false, async (err) => { + if (err) { + console.error(`AudioFrameworkTest: Set Stream Mute: VOICE_CALL: Callback: Error : ${err.message}`); + expect(false).assertTrue(); + } + else { + await audioManager.getVolume(audio.AudioVolumeType.VOICE_CALL, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == highVol) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audio.AudioVolumeType.VOICE_CALL, (err, data) => { + if (err) { + console.error(`AudioFrameworkTest: Callback : FALSE: VOICE_CALL : failed to get Mute Status ${err.message}`); + expect().assertFail(); + } + else if (data == false) { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: FALSE: PASS: ' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: FALSE: FAIL: ' + data); + expect(false).assertTrue(); + } + done(); + }); + } + done(); + }); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_022 + * @tc.name : mute - VOICE_CALL - Promise - ENAME + * @tc.desc : mute - VOICE_CALL - Promise - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_022', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, lowVol); + await audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true).then(() => { + console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute VOICE_CALL: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + await audioManager.mute(audio.AudioVolumeType.VOICE_CALL, false).then(async function () { + console.log('AudioFrameworkTest: Set Stream Mute: VOICE_CALL: Promise: FALSE'); + await audioManager.getVolume(audio.AudioVolumeType.VOICE_CALL).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == lowVol) { + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audio.AudioVolumeType.VOICE_CALL).then(function (data) { if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:' + data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: FALSE: PASS:' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: FALSE: FAIL: ' + data); + expect(false).assertTrue(); + } + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute VOICE_CALL: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + }).catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_023 + * @tc.name : mute - VOICE_ASSISTANT - callback - ENAME + * @tc.desc : mute - VOICE_ASSISTANT - callback - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_023', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, highVol); + await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true, (err) => { + if (err) { + console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + expect(false).assertTrue(); + } + console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + }); + await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, false, async (err) => { + if (err) { + console.error(`AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Callback: Error : ${err.message}`); + expect(false).assertTrue(); + } + else { + await audioManager.getVolume(audio.AudioVolumeType.VOICE_ASSISTANT, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == highVol) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT, (err, data) => { + if (err) { + console.error(`AudioFrameworkTest: Callback : FALSE: VOICE_ASSISTANT : failed to get Mute Status ${err.message}`); + expect().assertFail(); + } + else if (data == false) { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: FALSE: PASS: ' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: FALSE: FAIL: ' + data); + expect(false).assertTrue(); + } + done(); + }); + } + done(); + }); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_024 + * @tc.name : mute - VOICE_ASSISTANT - Promise - ENAME + * @tc.desc : mute - VOICE_ASSISTANT - Promise - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_024', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, lowVol); + await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true).then(() => { + console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute VOICE_ASSISTANT: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); + await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, false).then(async function () { + console.log('AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Promise: FALSE'); + await audioManager.getVolume(audio.AudioVolumeType.VOICE_ASSISTANT).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == lowVol) { expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: ' + data); expect(false).assertTrue(); } }); + await audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT).then(function (data) { + if (data == false) { + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: FALSE: PASS:' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: FALSE: FAIL: ' + data); + expect(false).assertTrue(); + } + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute VOICE_ASSISTANT: FALSE: ERROR:' + err.message); + expect(false).assertTrue(); + }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); + console.info('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: FALSE: ERROR:' + err.message); expect(false).assertTrue(); }); done(); @@ -2726,10 +3105,25 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_017', 0, async function (done) { - await audioManager.mute(audioMedia, true).then(function () { + await audioManager.setVolume(audioMedia, highVol); + await audioManager.mute(audioMedia, true).then(async function () { console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: TRUE'); - audioManager.setVolume(audioMedia, lowVol); - audioManager.isMute(audioMedia).then(function (data) { + await audioManager.getVolume(audioMedia, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == 0) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.setVolume(audioMedia, lowVol); + await audioManager.isMute(audioMedia).then(function (data) { if (data == false) { console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: PASS:' + data); expect(true).assertTrue(); @@ -2738,7 +3132,11 @@ describe('audioManager', function () { console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: FAIL: ' + data); expect(false).assertTrue(); } - }); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Media: SetVolume: ERROR:' + err.message); + expect(false).assertTrue(); + }); }).catch((err) => { console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: ERROR:' + err.message); expect(false).assertTrue(); @@ -2755,17 +3153,25 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_018', 0, async function (done) { - audioManager.mute(audioMedia, true, async (err) => { + await audioManager.setVolume(audioMedia, lowVol); + await audioManager.mute(audioMedia, true, async (err) => { if (err) { console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`); expect().assertFail(); } else { console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : TRUE'); - await sleep(100); + await audioManager.getVolume(audioMedia).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == 0) { + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); await audioManager.setVolume(audioMedia, highVol); - await sleep(100); - audioManager.isMute(audioMedia, (err, data) => { + await audioManager.isMute(audioMedia, (err, data) => { if (err) { console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); @@ -2794,8 +3200,18 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_019', 0, async function (done) { + await audioManager.setVolume(audioRingtone, lowVol); await audioManager.mute(audioRingtone, true).then(async function () { console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: SetVolume'); + await audioManager.getVolume(audioRingtone).then((value) => { + console.info("AudioFrameworkTest: value is " + value); + if (value == 0) { + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); await audioManager.setVolume(audioRingtone, highVol); await audioManager.isMute(audioRingtone).then(function (data) { if (data == false) { @@ -2806,7 +3222,11 @@ describe('audioManager', function () { console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: FAIL: ' + data); expect(false).assertTrue(); } - }); + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute Ringtone: SetVolume: ERROR:' + err.message); + expect(false).assertTrue(); + }); }).catch((err) => { console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: ERROR:' + err.message); expect(false).assertTrue(); @@ -2823,13 +3243,23 @@ describe('audioManager', function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_mute_020', 0, async function (done) { - audioManager.mute(audioRingtone, true, (err) => { + await audioManager.setVolume(audioRingtone, highVol); + audioManager.mute(audioRingtone, true, async (err) => { if (err) { console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`); expect().assertFail(); } else { console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : SetVolume'); + await audioManager.getVolume(audioRingtone).then((value) => { + if (value == 0) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); audioManager.setVolume(audioRingtone, lowVol); audioManager.isMute(audioRingtone, (err, data) => { if (err) { @@ -2851,6 +3281,196 @@ describe('audioManager', function () { }); }) + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_025 + * @tc.name : mute - VOICE_CALL - Promise - SetVolume + * @tc.desc : mute - VOICE_CALL - Promise - Enable mute -SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_025', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, highVol); + await audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true).then(async function () { + console.log('AudioFrameworkTest: Set Stream Mute: VOICE_CALL: Promise: TRUE'); + await audioManager.getVolume(audio.AudioVolumeType.VOICE_CALL, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == 0) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, lowVol); + await audioManager.isMute(audio.AudioVolumeType.VOICE_CALL).then(function (data) { + if (data == false) { + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: SetVolume: PASS:' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: SetVolume: FAIL: ' + data); + expect(false).assertTrue(); + } + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute VOICE_CALL: SetVolume: ERROR:' + err.message); + expect(false).assertTrue(); + }); + }).catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: SetVolume: ERROR:' + err.message); + expect(false).assertTrue(); + }); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_026 + * @tc.name : mute - VOICE_CALL - callback - SetVolume + * @tc.desc : mute - VOICE_CALL - callback - Enable mute - SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_026', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, highVol); + audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true, async (err) => { + if (err) { + console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_CALL : failed to set Mute Status ${err.message}`); + expect().assertFail(); + } + else { + console.log('AudioFrameworkTest: Set Stream Mute: VOICE_CALL: Callback : SetVolume'); + await audioManager.getVolume(audio.AudioVolumeType.VOICE_CALL).then((value) => { + if (value == 0) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); + audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, lowVol); + audioManager.isMute(audio.AudioVolumeType.VOICE_CALL, (err, data) => { + if (err) { + console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_CALL : failed to get Mute Status ${err.message}`); + expect().assertFail(); + } + else if (data == false) { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: SetVolume: PASS: ' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: SetVolume: FAIL: ' + data); + expect(false).assertTrue(); + } + done(); + }); + } + done(); + }); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_027 + * @tc.name : mute - VOICE_ASSISTANT - Promise - SetVolume + * @tc.desc : mute - VOICE_ASSISTANT - Promise - Enable mute -SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_027', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, highVol); + await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true).then(async function () { + console.log('AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Promise: TRUE'); + await audioManager.getVolume(audio.AudioVolumeType.VOICE_ASSISTANT, (err, value) => { + if (err) { + console.error(`Failed to obtain the volume. ${err.message}`); + expect(false).assertTrue(); + } + else if (value == 0) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + console.info("AudioFrameworkTest: mute fail"); + expect(false).assertTrue(); + } + }); + await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, lowVol); + await audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT).then(function (data) { + if (data == false) { + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS:' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: SetVolume: FAIL: ' + data); + expect(false).assertTrue(); + } + }) + .catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream isMute VOICE_ASSISTANT: SetVolume: ERROR:' + err.message); + expect(false).assertTrue(); + }); + }).catch((err) => { + console.info('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: SetVolume: ERROR:' + err.message); + expect(false).assertTrue(); + }); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_mute_028 + * @tc.name : mute - VOICE_ASSISTANT - callback - SetVolume + * @tc.desc : mute - VOICE_ASSISTANT - callback - Enable mute - SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_028', 0, async function (done) { + await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, highVol); + audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true, async (err) => { + if (err) { + console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_ASSISTANT : failed to set Mute Status ${err.message}`); + expect().assertFail(); + } + else { + console.log('AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Callback : SetVolume'); + await audioManager.getVolume(audio.AudioVolumeType.VOICE_ASSISTANT).then((value) => { + if (value == 0) { + console.info("AudioFrameworkTest: value is " + value); + expect(true).assertTrue(); + } + else { + expect(false).assertTrue(); + } + }); + audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, lowVol); + audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT, (err, data) => { + if (err) { + console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_ASSISTANT : failed to get Mute Status ${err.message}`); + expect().assertFail(); + } + else if (data == false) { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS: ' + data); + expect(true).assertTrue(); + } + else { + console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: FAIL: ' + data); + expect(false).assertTrue(); + } + done(); + }); + } + done(); + }); + }) + /* * * @tc.number : SUB_AUDIO_MANAGER_isActive_005 * @tc.name : isActive - Media - Promise @@ -4023,7 +4643,7 @@ describe('audioManager', function () { done(); }); }) - + /* * * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_012 @@ -4033,8 +4653,8 @@ describe('audioManager', function () { * @tc.type : Function * @tc.level : Level 0 */ - - it('SUB_AUDIO_MANAGER_getAudioParameter_012', 0, async function (done) { + + it('SUB_AUDIO_MANAGER_getAudioParameter_012', 0, async function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'xyza', (err) => { console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); if (err) { @@ -4059,7 +4679,7 @@ describe('audioManager', function () { done(); }); }) - + /* * * @tc.number : SUB_AUDIO_MANAGER_onVolumeChange_001 @@ -4496,18 +5116,31 @@ describe('audioManager', function () { done(); }) - /* * - * @tc.number : SUB_AUDIO_MANAGER_DeviceType_001 - * @tc.name : DeviceType - BLUETOOTH_SCO - * @tc.desc : DeviceType - BLUETOOTH_SCO - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_AUDIO_MANAGER_DeviceType_001', 0, async function (done) { + /* * + * @tc.number : SUB_AUDIO_MANAGER_DeviceType_001 + * @tc.name : DeviceType - BLUETOOTH_SCO + * @tc.desc : DeviceType - BLUETOOTH_SCO + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_DeviceType_001', 0, async function (done) { expect(audio.DeviceType.BLUETOOTH_SCO).assertEqual(7); await sleep(50); done(); }) + /* * + * @tc.number : SUB_AUDIO_MANAGER_DeviceType_002 + * @tc.name : DeviceType - WIRED_HEADPHONES + * @tc.desc : DeviceType - WIRED_HEADPHONES + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_DeviceType_002', 0, async function (done) { + expect(audio.DeviceType.WIRED_HEADPHONES).assertEqual(4); + await sleep(50); + done(); + }) }) \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js index b6b372889c78b091a0a6fd533be14f126b77373d..736a03a96791ca022d0996e229e3a7ec7908f592 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js @@ -15,8 +15,6 @@ import audio from '@ohos.multimedia.audio'; import fileio from '@ohos.fileio'; -import bundle from '@ohos.bundle'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import resourceManager from '@ohos.resourceManager'; import featureAbility from '@ohos.ability.featureAbility' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; @@ -31,7 +29,6 @@ describe('audioRenderer', function () { let filePath; beforeAll(async function () { - await applyPermission(); console.info('AudioFrameworkRenderLog: beforeAll: Prerequisites at the test suite level'); }) @@ -84,35 +81,6 @@ describe('audioRenderer', function () { }); } - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('AudioFrameworkRenderLog:[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - } else { - console.info('AudioFrameworkRenderLog:[permission] case apply permission failed, createAtManager failed'); - } - } - async function playbackPromise(AudioRendererOptions, pathName, AudioScene) { var resultFlag = 'new'; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js index af1c6601aad908a920b8d9e563077bd589016a3e..8d015a7333bd81793e2b0df41259fdfc588945a1 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRendererChangeInfo.test.js @@ -14,12 +14,6 @@ */ import audio from '@ohos.multimedia.audio'; -import fileio from '@ohos.fileio'; -import app from '@system.app'; -import bundle from '@ohos.bundle'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import featureAbility from '@ohos.ability.featureAbility' -import ability_featureAbility from '@ohos.ability.featureAbility'; import resourceManager from '@ohos.resourceManager'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; @@ -28,13 +22,11 @@ describe('audioRendererChange', function () { var audioStreamManager; var audioStreamManagerCB; let fdRead; - let readpath; var Tag = "AFRenLog : "; const audioManager = audio.getAudioManager(); console.info(Tag+'Create AudioManger Object JS Framework'); beforeAll(async function () { - await applyPermission(); await audioManager.getStreamManager().then(async function (data) { audioStreamManager = data; console.info(Tag+'Get AudioStream Manager : Success '); @@ -106,34 +98,6 @@ describe('audioRendererChange', function () { } }) } - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info(Tag+'[permission] case accessTokenID is '+tokenID); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info(Tag+'[permission] case grantUserGrantedPermission success :'+result); - }).catch((err) => { - console.info(Tag+'[permission] case grantUserGrantedPermission failed :'+err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info(Tag+'[permission] case grantUserGrantedPermission success :'+result); - }).catch((err) => { - console.info(Tag+'[permission] case grantUserGrantedPermission failed :'+err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info(Tag+'[permission] case grantUserGrantedPermission success :'+result); - }).catch((err) => { - console.info(Tag+'[permission] case grantUserGrantedPermission failed :'+err); - }); - } else { - console.info(Tag+'[permission] case apply permission failed, createAtManager failed'); - } - } /* * * @tc.number : SUB_AUDIO_ON_RENDERER_CHANGE_001 diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js index 757c64a73cb79415fb6f9654cab41a2d9116a2a0..053d449cfd60f17540a33f8f121f6337fe0dde4c 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioVOIP.test.js @@ -16,10 +16,6 @@ import audio from '@ohos.multimedia.audio'; import fileio from '@ohos.fileio'; -import ability_featureAbility from '@ohos.ability.featureAbility'; -import app from '@system.app'; -import bundle from '@ohos.bundle'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import featureAbility from '@ohos.ability.featureAbility' import resourceManager from '@ohos.resourceManager'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; @@ -33,11 +29,7 @@ describe('audioVoip', function () { const audioManager = audio.getAudioManager(); console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework'); - const audioManagerRec = audio.getAudioManager(); - console.info('AudioFrameworkRecLog: Create AudioManger Object JS Framework'); - beforeAll(async function () { - await applyPermission(); console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); //mediaDir = '/data/storage/el2/base/haps/entry/cache'; }) @@ -100,35 +92,6 @@ describe('audioVoip', function () { }); } - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('AudioFrameworkRenderLog:[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName2 = 'ohos.permission.READ_MEDIA'; - let permissionName3 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('AudioFrameworkRenderLog:[permission] case grantUserGrantedPermission failed :' + err); - }); - } else { - console.info('AudioFrameworkRenderLog:[permission] case apply permission failed, createAtManager failed'); - } - } - async function playbackPromise(AudioRendererOptions, pathName, AudioScene) { var resultFlag = 'new'; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); @@ -515,7 +478,7 @@ describe('audioVoip', function () { } await getAbilityInfo("capture_js-44100-2C-16B-2.pcm"); - recPromise(AudioCapturerOptions, mediaDir, audio.AudioScene.AUDIO_SCENE_PHONE_CHAT); + await recPromise(AudioCapturerOptions, mediaDir, audio.AudioScene.AUDIO_SCENE_PHONE_CHAT); await sleep(500); readpath = 'StarWars10s-1C-44100-2SW.wav'; diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/getPermission.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/getPermission.test.js index e836f8f47f34f46292e356452913de5c5a7b2bdc..31d080975f8e50f3b12538958c45a8ea1b6c3413 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/getPermission.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/getPermission.test.js @@ -16,9 +16,17 @@ import { describe, beforeAll,afterAll, it, expect } from 'deccjsunit/index'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import bundle from '@ohos.bundle'; - +import account from '@ohos.account.osAccount'; describe("get_permission", function () { - + let userId ; + async function getUserId () { + await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => { + console.info("getOsAccountLocalIdFromProcess userid ==========" + account); + userId = account; + }).catch(err=>{ + console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err)); + }) + } /** * @tc.number SUB_DF_GRANT_USER_GRANTED_PERMISSION_0000 * @tc.name grant_user_granted_permission_async_000 @@ -29,7 +37,8 @@ describe("get_permission", function () { * @tc.require */ it("grant_user_granted_permission_async_000", 0, async function (done) { - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, 100); + await getUserId(); + let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.audio.audiomanager', 0, userId); let tokenID = appInfo.accessTokenId; let atManager = abilityAccessCtrl.createAtManager(); let result1 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MEDIA_LOCATION",1); diff --git a/security_lite/deviceauth_basic_deps/BUILD.gn b/security_lite/deviceauth_basic_deps/BUILD.gn index f77dc2b15ffcf14e1917a6a99a318cf3c18d7e7e..74b10c4ea41ecb7bd664768057d60248c17e3f19 100644 --- a/security_lite/deviceauth_basic_deps/BUILD.gn +++ b/security_lite/deviceauth_basic_deps/BUILD.gn @@ -59,9 +59,9 @@ hctest_suite("ActsSecurityHichainBasicDeps") { ] if (ohos_kernel_type == "liteos_m") { # liteos m - include_dirs += [ "//base/startup/syspara_lite/interfaces/kits" ] - deps += - [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ] + include_dirs += + [ "//base/startup/init/interfaces/innerkits/include/syspara" ] + deps += [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] if (board_name == "rtl8720") { cflags += [ "-isystem${ohos_root_path}/kernel/liteos_m/kal/posix/include" ] @@ -134,19 +134,17 @@ hctest_suite("ActsSecurityHichainBasicDeps") { } } else { #liteos a or L1 linux - include_dirs += [ "//base/startup/syspara_lite/interfaces/kits" ] - deps += - [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ] + include_dirs += + [ "//base/startup/init/interfaces/innerkits/include/syspara" ] + deps += [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] } } else { # linux include_dirs += [ - "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include", + "//base/startup/init/interfaces/innerkits/include/syspara", "//base/security/device_auth/deps_adapter/os_adapter/interfaces/linux", ] - deps += [ - "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", - ] + deps += [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] } } diff --git a/startup_lite/syspara_hal/BUILD.gn b/startup_lite/syspara_hal/BUILD.gn index 23b3244fb39e5afa64d91f1739f923d5b1e6ba4e..b9f1f6356a6dd90fbe71357056663a51f5092641 100755 --- a/startup_lite/syspara_hal/BUILD.gn +++ b/startup_lite/syspara_hal/BUILD.gn @@ -23,7 +23,7 @@ hctest_suite("ActsParameterTest") { include_dirs = [ "src", - "//base/startup/syspara_lite/interfaces/kits", + "///base/startup/init/interfaces/innerkits/include/syspara", ] cflags = [ "-Wno-error" ] } diff --git a/startup_lite/syspara_posix/BUILD.gn b/startup_lite/syspara_posix/BUILD.gn index 0c433d058c0dcaebd518b1ca5bb96f81d148cd4e..7a1829a4a3bdff2afa20419f50508464ae985104 100755 --- a/startup_lite/syspara_posix/BUILD.gn +++ b/startup_lite/syspara_posix/BUILD.gn @@ -19,10 +19,10 @@ hcpptest_suite("ActsParameterTest") { include_dirs = [ "src", - "//base/startup/syspara_lite/interfaces/kits", + "//base/startup/init/interfaces/innerkits/include/syspara", ] - deps = [ "//base/startup/syspara_lite/frameworks/parameter:parameter" ] + deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] cflags = [ "-Wno-error" ] ldflags = [ "-lstdc++",