diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets index 52663437cb619d4598126cf403d3689cb31ba131..ebe2a118a93e1b8744707100e2e7c26cdfb99610 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import router from '@system.router'; @Entry @Component diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets index a19602275ba7929208eb82dc9d599402e54f91af..e91baa031afd9a1462cd14596f98fbaa481ecff9 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets @@ -46,20 +46,6 @@ export default function getHapModuleInfoJsunit() { done(); }); - async function startAbility2() { - var str = { - "want": { - "bundleName": "com.ohos.acecollaboration", - "abilityName": "com.ohos.acecollaboration.MainAbility2", - }, - }; - ability_featureAbility.startAbility(str).then((data) => { - console.info('context_getAbilityInfo_test_0300 startMainAbility2 succeeded: ' + JSON.stringify(data)); - }).catch((error) => { - console.error('context_getAbilityInfo_test_0300 startMainAbility2 failed. Cause: ' + JSON.stringify(error)); - }); - } - /** * @tc.number: context_getAbilityInfo_test_0200 * @tc.name: getAbilityInfo:Query the current attributionability details. @@ -88,19 +74,6 @@ export default function getHapModuleInfoJsunit() { done(); }) - - /** - * @tc.number: context_getAbilityInfo_test_0300_1 - * @tc.name: getAbilityInfo:Query the current attributionability details. - * @tc.desc: Check the return value of the interface - * @tc.level 0 - */ - it('context_getAbilityInfo_test_0300_1', 0, async function (done) { - console.info('[context_getAbilityInfo_test_0300] STARTability'); - startAbility2(); - done(); - }); - /** * @tc.number: context_getAbilityInfo_test_0400 * @tc.name: getAbilityInfo:Query the current attributionability details. diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/BUILD.gn b/ability/ability_runtime/actsstserviceabilityclientcase/BUILD.gn index 90f40cc40ac493a464a10ca593a6c971ab72e21b..14beae6bca4c09774853d011f12f2b7df54a1cb1 100644 --- a/ability/ability_runtime/actsstserviceabilityclientcase/BUILD.gn +++ b/ability/ability_runtime/actsstserviceabilityclientcase/BUILD.gn @@ -23,9 +23,12 @@ ohos_js_hap_suite("ActsStServiceAbilityClientCaseTest") { hap_name = "ActsStServiceAbilityClientCaseTest" } ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" + js2abc = true + hap_profile = "./entry/src/main/config.json" + source_dir = "./entry/src/main/js" } + ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] + sources = [ "./entry/src/main/resources" ] hap_profile = "./entry/src/main/config.json" } diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/Test.json b/ability/ability_runtime/actsstserviceabilityclientcase/Test.json index cd03f2a6b0adfe4da3313dcd27edf49060484d4e..2daec42148e279bf5897eadf8c645cf4296120aa 100644 --- a/ability/ability_runtime/actsstserviceabilityclientcase/Test.json +++ b/ability/ability_runtime/actsstserviceabilityclientcase/Test.json @@ -1,10 +1,11 @@ { "description": "Configuration for hjunit demo Tests", "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.amsst.actsstserviceabilityclientcasetest", - "shell-timeout": "60000" + "type": "OHJSUnitTest", + "test-timeout": "300000", + "bundle-name": "com.amsst.actsstserviceabilityclientcasetest", + "package-name": "com.amsst.actsstserviceabilityclientcasetest", + "shell-timeout": "600000" }, "kits": [ { diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json index a969be745a7aba3a3b3a4b1da5ba0c9befde3237..da803ed692c2f99e99039294f6204ab21eea2b70 100644 --- a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json @@ -15,14 +15,16 @@ "deviceConfig": {}, "module": { "package": "com.amsst.actsstserviceabilityclientcasetest", - "name": ".MyApplication", + "name": ".entry", + "mainAbility": "com.amsst.actsstserviceabilityclientcasetest.MainAbility", "deviceType": [ "phone" ], "distro": { "deliveryWithInstall": true, "moduleName": "entry", - "moduleType": "entry" + "moduleType": "entry", + "installationFree": true }, "abilities": [ { @@ -37,12 +39,27 @@ } ], "name": "com.amsst.actsstserviceabilityclientcasetest.MainAbility", + "srcLanguage": "js", + "srcPath": "MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", "type": "page", "launchType": "standard", "visible": true + }, + { + "orientation": "unspecified", + "formsEnabled": false, + "name": ".TestAbility", + "srcLanguage": "js", + "srcPath": "TestAbility", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "label": "$string:TestAbility_label", + "type": "page", + "visible": true, + "launchType": "singleton" } ], "reqPermissions": [ @@ -80,12 +97,26 @@ "pages": [ "pages/index/index" ], - "name": "default", + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": ".TestAbility", "window": { "designWidth": 720, "autoDesignWidth": false } } - ] + ], + "testRunner": { + "name": "OpenHarmonyTestRunner", + "srcPath": "TestRunner" + } } } diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/app.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/app.js similarity index 100% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/app.js rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/app.js diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/i18n/en-US.json similarity index 100% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/i18n/en-US.json diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/i18n/zh-CN.json similarity index 100% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/i18n/zh-CN.json diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/pages/index/index.css similarity index 100% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/pages/index/index.css diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/pages/index/index.hml similarity index 100% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/pages/index/index.hml diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/pages/index/index.js similarity index 54% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/pages/index/index.js index 8ea0eedbb7b0ca5759444d12e5761cb5c3fab9c5..0b672f833ab0e8c4da6467465fd1b4e54ff4c1d1 100644 --- a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/MainAbility/pages/index/index.js @@ -12,10 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import file from '@system.file' -import app from '@system.app' -import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index' - +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') export default { data: { title: "" @@ -24,21 +22,9 @@ export default { this.title = this.$t('strings.world'); }, onShow() { - console.info('====onShow finish====<') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - const reportExtend = new ReportExtend(file) - core.addService('expect', expectExtend) - core.addService('report', reportExtend) - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() + console.info('====onShow start====<') }, onReady() { + console.info('onReady'); }, } \ No newline at end of file diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/app.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..d5ee271df29e516d1c8929054283e5f2bf5c981c --- /dev/null +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/app.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/List.test' + +export default { + onCreate() { + console.info('TestApplication onCreate') + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + }, + onDestroy() { + console.info("TestApplication onDestroy"); + } +}; diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/i18n/en-US.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/i18n/zh-CN.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.css b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..56e3f23b7600859d82213a7d24d8756f9f32480a --- /dev/null +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.css @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} + +@media screen and (device-type: phone) and (orientation: landscape) { + .title { + font-size: 60px; + } +} + +@media screen and (device-type: tablet) and (orientation: landscape) { + .title { + font-size: 100px; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.hml b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..6069a046a35c4409ab85e4595a079a1670a9c7fe --- /dev/null +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d94b75c085fa1c16a0b2721609b18c57a7295476 --- /dev/null +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestAbility/pages/index/index.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} + + + diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestRunner/OpenHarmonyTestRunner.js new file mode 100644 index 0000000000000000000000000000000000000000..b9e78ce7cf73f1ade6ba52a408a44e33f5430f0d --- /dev/null +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/TestRunner/OpenHarmonyTestRunner.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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' + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s package', '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams += ' ' + key + ' ' + parameters[key] + } + } + return targetParams.trim() +} + + export default { + onPrepare() { + console.info('OpenHarmonyTestRunner OnPrepare') + }, + onRun() { + console.log('OpenHarmonyTestRunner onRun run') + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + + var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' + + var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + console.info('debug value : '+debug) + if (debug == 'true') + { + cmd += ' -D' + } + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + data.stdResult); + console.info('executeShellCommand : data : ' + data.exitCode); + }) + } +}; diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js index ad64aff7631daaa36324dd282bf7c18ccc289b10..d6eca4fefdccc39dea0d624ca674a4a817df09cd 100644 --- a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js @@ -14,10 +14,11 @@ */ import featureAbility from '@ohos.ability.featureAbility' import commonEvent from '@ohos.commonEvent' -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -const errCode = 1; +const errCode = 1; +export default function ActsStServiceAbilityTest() { describe('ActsStServiceAbilityTest', function () { let bundleName = "com.amsst.stserviceabilityserver"; let abilityName = "com.amsst.stserviceabilityserver.ServiceAbility"; @@ -270,6 +271,7 @@ it("ACTS_AAbilityStartSettingNew_0500",0, async function(done){ console.log('ACTS_AJsServiceAbility_0600==== { console.debug("=ACTS_AJsServiceAbility_0600 createSubscriber .then(data)=======>" + ("json data【") + JSON.stringify(data) + (" 】") @@ -429,4 +431,5 @@ it("ACTS_AAbilityStartSettingNew_0500",0, async function(done){ done(); } }) -}) \ No newline at end of file +}) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js index 83c4d53aea8924cf20a56db16db1d2fbfe040fe6..b19458af6450392d9ee9beca7adb6c957ab5e86c 100644 --- a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js @@ -12,4 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -require('./ActsStServiceAbilityClientCaseTest.test.js') \ No newline at end of file +import ActsStServiceAbilityTest from './ActsStServiceAbilityClientCaseTest.test.js' + +export default function testsuite() { + ActsStServiceAbilityTest() +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/resources/base/element/string.json similarity index 54% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/resources/base/element/string.json index a3d6946ded2ae6c810549377cc0c386ad257eb53..392f4c583d5599efca8f3ce70786390d03521b20 100644 --- a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json +++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/resources/base/element/string.json @@ -7,6 +7,14 @@ { "name": "mainability_description", "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "TestAbility_desc", + "value": "description" + }, + { + "name": "TestAbility_label", + "value": "label" } ] } \ No newline at end of file diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts index 4ca5011008cfcf3af89fe1b915a9a284832631bd..cdc3a115e142a58f8b541720bd9d04f27d0c9445 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts @@ -18,6 +18,6 @@ export default class MyAbilityStage extends AbilityStage { onCreate() { console.log("MyAbilityStage onCreate") // globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; + globalThis.abilityStageContext = this.context; } } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts index d4c4a376cc928d8ab87cdede49f70b964d34dee9..5d9cb94eb1b16f32da7f1ba0b9896c87323bca11 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -29,7 +29,7 @@ export default class MainAbility extends Ability { onWindowStageCreate(windowStage) { // Main window is created, set main page for this ability console.log("MainAbility onWindowStageCreate") - globalThis.abilityStageContext = this.context + globalThis.abilityContext = this.context windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null) } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets index 99a54c3b59b84d7a236abf3eaf52dcaa9a3e0aff..bbefdd9c2bd7530934268ca3e11b965fb6bce0a8 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets @@ -25,7 +25,7 @@ export default function abilityTest() { */ it('ACTS_getApplicationInfo_0300', 0, async function (done) { console.log("ACTS_getApplicationInfo_0300 --- start ability=====>'+ abilityContext.applicationInfo") - checkApplicationInfo(globalThis.abilityStageContext.applicationInfo); + checkApplicationInfo(globalThis.abilityContext.applicationInfo); done(); }) @@ -93,33 +93,33 @@ export default function abilityTest() { expect(typeof (data.removable)).assertEqual("boolean"); console.log("checkApplicationInfo_expect_typeof_end") - expect(data.name).assertEqual("com.example.staticglobalThis.abilityStageContext"); + expect(data.name).assertEqual("com.example.staticabilitystagecontext"); expect(data.description).assertEqual("$string:description_application"); expect(data.descriptionId).assertLarger(0); expect(data.systemApp).assertEqual(true); expect(data.enabled).assertEqual(true); expect(data.label).assertEqual("$string:app_name"); expect(data.labelId.length).assertLarger(0); - expect(data.icon).assertEqual(""); + expect(data.icon).assertEqual("$media:icon"); expect(data.iconId.length).assertLarger(0); expect(data.process).assertEqual(""); expect(data.supportedModes).assertEqual(0); expect(data.moduleSourceDirs.length).assertEqual(1); expect(data.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticglobalThis.abilityStageContext/com.example.staticglobalThis.abilityStageContext"); + "com.example.staticabilitystagecontext/com.example.staticabilitystagecontext"); expect(data.moduleInfos.length).assertEqual(1); - expect(data.moduleInfos[0].moduleName).assertEqual("com.example.staticglobalThis.abilityStageContext"); + expect(data.moduleInfos[0].moduleName).assertEqual("com.example.staticabilitystagecontext"); expect(data.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticglobalThis.abilityStageContext/com.example.staticglobalThis.abilityStageContext"); + "com.example.staticabilitystagecontext/com.example.staticabilitystagecontext"); expect(data.entryDir).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticglobalThis.abilityStageContext/com.example.staticglobalThis.abilityStageContext"); + "com.example.staticabilitystagecontext/com.example.staticabilitystagecontext"); expect(data.codePath).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticglobalThis.abilityStageContext"); + "com.example.staticabilitystagecontext"); expect(data.removable).assertEqual(true); console.log("checkApplicationInfo end " + data); } function checkHapModuleInfo(data) { - console.log("checkHapModuleInfo start " + data); + console.log("checkHapModuleInfo start " + JSON.stringify(data)); console.log("checkHapModuleInfo name : " + data.name); console.log("checkHapModuleInfo description : " + data.description); console.log("checkHapModuleInfo descriptionId : " + data.descriptionId); @@ -154,22 +154,23 @@ export default function abilityTest() { expect(typeof (data.moduleName)).assertEqual("string"); expect(typeof (data.mainAbilityName)).assertEqual("string"); console.log("checkHapModuleInfo_expect_typeof_end") - expect(data.name).assertEqual("com.example.staticglobalThis.abilityStageContext"); + expect(data.name).assertEqual("com.example.staticabilitystagecontext"); expect(data.description).assertEqual("$string:phone_entry_dsc"); - expect(data.descriptionId).assertEqual(undefined); + expect(data.descriptionId).assertEqual(16777221); expect(data.icon).assertEqual("$media:icon"); expect(data.label).assertEqual("$string:entry_label"); - expect(data.labelId).assertEqual(undefined); - expect(data.iconId).assertEqual(undefined); + expect(data.labelId).assertEqual(16777219); + expect(data.iconId).assertEqual(16777224); expect(data.backgroundImg).assertEqual(""); expect(data.supportedModes).assertEqual(0); expect(data.reqCapabilities.length).assertEqual(0); - expect(data.reqCapabilities[0]).assertEqual(undefined); expect(data.deviceTypes.length).assertEqual(1); expect(data.deviceTypes[0]).assertEqual("phone"); - expect(data.moduleName).assertEqual("com.example.staticglobalThis.abilityStageContext") - expect(data.mainAbilityName).assertEqual("MainAbility"); - expect(data.installationFree).assertEqual(undefined); + expect(data.moduleName).assertEqual("com.example.staticabilitystagecontext") + expect(data.mainAbilityName).assertEqual("com.example.staticabilitystagecontext.MainAbility"); + expect(data.installationFree).assertEqual(false); + expect(data.mainElementName).assertEqual('com.example.staticabilitystagecontext.MainAbility'); + expect(data.hashValue).assertEqual(''); console.log("checkHapModuleInfo end " + data); } }) diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json index c3fd9d3d85c818b4b098acd270c2ef53b3a62a13..f9b841630cfded042ceeff3689be922bcc26e06b 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json @@ -4,7 +4,7 @@ "type": "entry", "srcEntrance": "./ets/Application/AbilityStage.ts", "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", + "mainElement": "com.example.staticabilitystagecontext.MainAbility", "deviceTypes": [ "phone" ], diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json index 7c9e5a72882896bf2acf1f64e4b74208a16b4b45..d9a51d0c364eb8e882e2fdcd58d464992fc42a8e 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json @@ -4,7 +4,7 @@ "type": "entry", "srcEntrance": "./ets/Application/AbilityStage.ts", "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", + "mainElement": "com.example.staticextensioninfotest.MainAbility", "deviceTypes": [ "phone" ], diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets index 45879adaf111e2ea40b3c8bc73512c3de8802b66..53d5695b47ef919a908598bc96a2d8621bc4c70f 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets @@ -118,20 +118,21 @@ export default function abilityTest() { console.log("checkHapModuleInfo_expect_typeof_end") expect(data.name).assertEqual("phone"); expect(data.description).assertEqual("$string:phone_entry_dsc"); - expect(data.descriptionId).assertEqual(undefined); + expect(data.descriptionId).assertEqual(16777221); expect(data.icon).assertEqual("$media:icon"); expect(data.label).assertEqual("$string:entry_label"); - expect(data.labelId).assertEqual(undefined); - expect(data.iconId).assertEqual(undefined); + expect(data.labelId).assertEqual(16777219); + expect(data.iconId).assertEqual(16777224); expect(data.backgroundImg).assertEqual(""); expect(data.supportedModes).assertEqual(0); expect(data.reqCapabilities.length).assertEqual(0); - expect(data.reqCapabilities[0]).assertEqual(undefined); expect(data.deviceTypes.length).assertEqual(1); expect(data.deviceTypes[0]).assertEqual("phone"); expect(data.moduleName).assertEqual("phone") - expect(data.mainAbilityName).assertEqual("MainAbility"); - expect(data.installationFree).assertEqual(undefined); + expect(data.mainAbilityName).assertEqual("com.example.staticextensioninfo.MainAbility"); + expect(data.installationFree).assertEqual(false); + expect(data.mainElementName).assertEqual('com.example.staticextensioninfo.MainAbility'); + expect(data.hashValue).assertEqual(''); console.log("checkHapModuleInfo end " + data); } function checkApplicationInfo(data) { @@ -191,7 +192,7 @@ export default function abilityTest() { expect(data.enabled).assertEqual(true); expect(data.label).assertEqual("$string:app_name"); expect(data.labelId).assertEqual("16777216"); - expect(data.icon).assertEqual(""); + expect(data.icon).assertEqual("$media:icon"); expect(data.iconId).assertEqual("16777224"); expect(data.process).assertEqual(""); expect(data.supportedModes).assertEqual(0); @@ -299,20 +300,21 @@ export default function abilityTest() { console.log("checkHapModuleInfo_expect_typeof_end") expect(data.name).assertEqual("phone"); expect(data.description).assertEqual("$string:phone_entry_dsc"); - expect(data.descriptionId).assertEqual(undefined); + expect(data.descriptionId).assertEqual(16777221); expect(data.icon).assertEqual("$media:icon"); expect(data.label).assertEqual("$string:entry_label"); - expect(data.labelId).assertEqual(undefined); - expect(data.iconId).assertEqual(undefined); + expect(data.labelId).assertEqual(16777219); + expect(data.iconId).assertEqual(16777224); expect(data.backgroundImg).assertEqual(""); expect(data.supportedModes).assertEqual(0); expect(data.reqCapabilities.length).assertEqual(0); - expect(data.reqCapabilities[0]).assertEqual(undefined); expect(data.deviceTypes.length).assertEqual(1); expect(data.deviceTypes[0]).assertEqual("phone"); expect(data.moduleName).assertEqual("phone") - expect(data.mainAbilityName).assertEqual("MainAbility"); - expect(data.installationFree).assertEqual(undefined); + expect(data.mainAbilityName).assertEqual("com.example.staticextensioninfotest.MainAbility"); + expect(data.installationFree).assertEqual(false); + expect(data.mainElementName).assertEqual('com.example.staticextensioninfotest.MainAbility'); + expect(data.hashValue).assertEqual(''); console.log("checkHapModuleInfo end " + data); } function checkApplicationInfo_0200(data) { @@ -372,7 +374,7 @@ export default function abilityTest() { expect(data.enabled).assertEqual(true); expect(data.label).assertEqual("$string:app_name"); expect(data.labelId.length).assertLarger(0); - expect(data.icon).assertEqual(""); + expect(data.icon).assertEqual("$media:icon"); expect(data.iconId.length).assertLarger(0); expect(data.process).assertEqual(""); expect(data.supportedModes).assertEqual(0); diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json index 0fb12a5a8e89cbba99e1a8e5f08b874681e3e67b..93021963968c39cb1354f3d4514fc88c556a59a3 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json @@ -4,7 +4,7 @@ "type": "entry", "srcEntrance": "./ets/Application/AbilityStage.ts", "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", + "mainElement": "com.example.staticextensioninfo.MainAbility", "deviceTypes": [ "phone" ], diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/pages/index/index.ets index 52f3af9da0d968198bc89d90e7d87b82257d73c6..0cd40d5a5f0e77da35c83f2fc591387691bcf584 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/pages/index/index.ets +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -12,9 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import file from '@system.file'; -import router from '@ohos.router'; import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import { Hypium } from '@ohos/hypium' import testsuite from '../../../test/List.test' diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets index aa3947a877e7a725afffb6d5ee878fe215c8a0c1..9f0e309acca3b27f5024d5910a32992b2ecb9013 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets @@ -20,9 +20,6 @@ import commonEvent from '@ohos.commonEvent' var subscriberInfo_MainAbility_ability = { events: ["MainAbility_Start_CommonEvent_ability", "SecondAbility_Start_CommonEvent_ability"], }; -var subscriberInfo_MainAbility_ability_0300 = { - events: ["MainAbility_Start_CommonEvent_ability_0300","SecondAbility_Start_CommonEvent_ability_0300"], -}; export default function abilityTest() { describe('ActsStaticInfoMationQueryTest', function () { @@ -101,10 +98,10 @@ export default function abilityTest() { commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); } } - commonEvent.createSubscriber(subscriberInfo_MainAbility_ability).then(async (data) => { + await commonEvent.createSubscriber(subscriberInfo_MainAbility_ability).then(async (data) => { console.debug("ACTS_getAbilityInfo_0200====>Create Subscriber====>"); Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); + await commonEvent.subscribe(Subscriber, SubscribeCallBack); Subscriber.getSubscribeInfo().then((data)=>{ console.log('ACTS_getAbilityInfo_0200 - Subscriber: ' + JSON.stringify(data)) }) @@ -287,7 +284,7 @@ export default function abilityTest() { expect(data.enabled).assertEqual(true); expect(data.label).assertEqual("$string:app_name"); expect(data.labelId.length).assertLarger(0); - expect(data.icon).assertEqual(""); + expect(data.icon).assertEqual("$media:icon"); expect(data.iconId.length).assertLarger(0); expect(data.process).assertEqual(""); expect(data.supportedModes).assertEqual(0); @@ -343,20 +340,21 @@ export default function abilityTest() { console.log("checkHapModuleInfo_expect_typeof_end") expect(data.name).assertEqual("com.example.staticinfomationquery"); expect(data.description).assertEqual("$string:phone_entry_dsc"); - expect(data.descriptionId).assertEqual(undefined); + expect(data.descriptionId).assertEqual(16777221); expect(data.icon).assertEqual("$media:icon"); expect(data.label).assertEqual("$string:entry_label"); - expect(data.labelId).assertEqual(undefined); - expect(data.iconId).assertEqual(undefined); + expect(data.labelId).assertEqual(16777219); + expect(data.iconId).assertEqual(16777224); expect(data.backgroundImg).assertEqual(""); expect(data.supportedModes).assertEqual(0); expect(data.reqCapabilities.length).assertEqual(0); - expect(data.reqCapabilities[0]).assertEqual(undefined); expect(data.deviceTypes.length).assertEqual(1); expect(data.deviceTypes[0]).assertEqual("phone"); expect(data.moduleName).assertEqual("com.example.staticinfomationquery") - expect(data.mainAbilityName).assertEqual("MainAbility"); - expect(data.installationFree).assertEqual(undefined); + expect(data.mainAbilityName).assertEqual("com.example.staticinfomationquery.MainAbility"); + expect(data.installationFree).assertEqual(false); + expect(data.mainElementName).assertEqual('com.example.staticinfomationquery.MainAbility'); + expect(data.hashValue).assertEqual(''); console.log("checkHapModuleInfo end " + data); } }) diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json index 9428138b0d8bf374c48986815a473c69a1159672..ac0e4ad2be8ba1dee339b5c10b40c7625b45d382 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json @@ -4,7 +4,7 @@ "type": "entry", "srcEntrance": "./ets/Application/AbilityStage.ts", "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", + "mainElement": "com.example.staticinfomationquery.MainAbility", "deviceTypes": [ "phone" ], diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts index 8bb08101ad08f7e3f1842c365da7017d7bcfca1f..054401cd37a2538383d834ce53f5a6e6c26986d7 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -43,7 +43,7 @@ export default class MainAbility extends Ability { onForeground() { // Ability has brought to foreground - if (globalThis.abilityWant.action == 'getAbilityContext') { + if (globalThis.abilityWant.action == 'getglobalThis.abilityContext') { commonEvent.publish("MainAbility_Start_CommonEvent_ability", { parameters: { hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json index 0ce61208099ffe286685f55b01b2851e76254518..fc48f59c88fc99108c079b53ebdf81d9caa0f39e 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json @@ -20,6 +20,7 @@ "module": { "package": "com.example.actsfeatureabilitytest", "name": ".MyApplication", + "mainAbility": "com.example.actsfeatureabilitytest.MainAbility", "deviceType": [ "phone" ], diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js index 8465f43e901937f8cf94bef01435f166d24046c8..31899e565c9dd3fc36f399b0f36a2fa4a6c34618 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js @@ -327,13 +327,13 @@ describe('ActsFeatureAbilityTest', function () { function SubscribeCallBack(err, data) { clearTimeout(id); + expect(promise).assertEqual(0); expect(data.event).assertEqual("ACTS_StartAbility_0200_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); } - commonEvent.createSubscriber(subscriberInfoActsStartAbility0200).then(async (data) => { + await commonEvent.createSubscriber(subscriberInfoActsStartAbility0200).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -407,7 +407,6 @@ describe('ActsFeatureAbilityTest', function () { }, } ); - expect(promise).assertEqual(0); }) /** @@ -687,7 +686,6 @@ describe('ActsFeatureAbilityTest', function () { expect(data.event).assertEqual("ACTS_StartAbility_0600_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); } commonEvent.createSubscriber(subscriberInfoActsStartAbility0600).then(async (data) => { @@ -1104,7 +1102,7 @@ describe('ActsFeatureAbilityTest', function () { expect(data.moduleName).assertEqual("entry"); expect(data.process).assertEqual("processTestAbility"); expect(data.targetAbility).assertEqual(""); - expect(data.backgroundModes).assertEqual(0); + expect(data.backgroundModes).assertEqual(1); expect(data.isVisible).assertEqual(true); expect(data.formEnabled).assertEqual(false); expect(data.type).assertEqual(1); @@ -1185,20 +1183,20 @@ describe('ActsFeatureAbilityTest', function () { expect(typeof (data.moduleName)).assertEqual("string"); expect(typeof (data.mainAbilityName)).assertEqual("string"); expect(typeof (data.installationFree)).assertEqual("boolean"); - expect(data.name).assertEqual("com.example.actsfeatureabilitytest"); + expect(data.name).assertEqual("com.example.actsfeatureabilitytest.MyApplication"); expect(data.description).assertEqual("descriptionTest"); expect(data.descriptionId).assertEqual(0); expect(data.icon).assertEqual("$media:icon"); expect(data.label).assertEqual("$string:app_name"); - expect(data.labelId).assertEqual(0); - expect(data.iconId).assertEqual(0); + expect(data.labelId).assertEqual(16777216); + expect(data.iconId).assertEqual(16777219); expect(data.backgroundImg).assertEqual(""); expect(data.supportedModes).assertEqual(0); expect(data.reqCapabilities[0]).assertEqual("reqCapabilitiesTest1"); expect(data.reqCapabilities[1]).assertEqual("reqCapabilitiesTest2"); expect(data.deviceTypes[0]).assertEqual("phone"); expect(data.moduleName).assertEqual("entry") - expect(data.mainAbilityName).assertEqual(""); + expect(data.mainAbilityName).assertEqual("com.example.actsfeatureabilitytest.MainAbility"); expect(data.installationFree).assertEqual(false); console.info("checkHapModuleInfo end " + data); } @@ -1578,7 +1576,6 @@ describe('ActsFeatureAbilityTest', function () { expect(data.event).assertEqual("ACTS_StartAbility_1300_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - done(); } commonEvent.createSubscriber(subscriberInfoStartAbilityThirteen).then(async (data) => {