diff --git a/appexecfwk/bundle_standard/bundlemanager/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/BUILD.gn index 6ed119e142d96957a8461f6180d7da8c5990a892..4d8ecf74068525560e60d13b414a532d6cef1d24 100755 --- a/appexecfwk/bundle_standard/bundlemanager/BUILD.gn +++ b/appexecfwk/bundle_standard/bundlemanager/BUILD.gn @@ -17,7 +17,24 @@ group("bundlemanager") { testonly = true if (is_standard_system) { deps = [ + "actsbmsallshortcutinfotest:ActsBmsAllShortcutInfoTest", + "actsbmscheckpermissiontest:ActsBmsCheckPermissionTest", + "actsbmshapmoduletest:ActsBmsHapModuleTest", + "actsbmsjstest:ActsBmsJsTest", + "actsbmsmetadatatest:ActsBmsMetaDataTest", + "actsbmsmoduleusagerecordtest:ActsBmsModuleUsageRecordTest", "actsbundlemanagertest:ActsBundleManagerTest", + "sceneProject/bmsgetinfosfifthscene:bmsThirdBundleTest5", + "sceneProject/bmsgetinfosfirstscene:bmsThirdBundleTest1", + "sceneProject/bmsgetinfosfirstsceneupdate:bmsThirdBundleTestA1", + "sceneProject/bmsgetinfosfourthscene:bmsThirdBundleTest4", + "sceneProject/bmsgetinfosjsscene:bmsThirdBundleJs", + "sceneProject/bmsgetinfosscenesystem:bmsSystemBundleTest1", + "sceneProject/bmsgetinfosscenevendor:bmsVendorBundleTest1", + "sceneProject/bmsgetinfossecondscene:bmsThirdBundleTest2", + "sceneProject/bmsgetinfosthirdscene:bmsThirdBundleTest3", + "sceneProject/bmsmainabilityfirstscene:bmsMainAbilityFirstScene", + "sceneProject/bmsmainabilitysecondscene:bmsMainAbilitySecondScene", "sceneProject/bmssceneeight:bmsJstest8", "sceneProject/bmsscenefive:bmsJstest5", "sceneProject/bmsscenefour:bmsJstest4", diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..48e837ab0c3453196f365b228da5ee33e00568ed --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsBmsAllShortcutInfoTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBmsAllShortcutInfoTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..0ffb97e5e3afde8dca23577ddbbb7faccb80863e --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/Test.json @@ -0,0 +1,41 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "21600000", + "package": "com.example.actsbmsallshortcutinfotest", + "shell-timeout": "21600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsBmsAllShortcutInfoTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount", + "mkdir /data/test" + ] + }, + { + "type": "PushKit", + "push": [ + "bmsThirdBundleTest1.hap->/data/test/bmsThirdBundleTest1.hap", + "bmsThirdBundleTest2.hap->/data/test/bmsThirdBundleTest2.hap", + "bmsThirdBundleTest3.hap->/data/test/bmsThirdBundleTest3.hap", + "bmsThirdBundleTest4.hap->/data/test/bmsThirdBundleTest4.hap", + "bmsThirdBundleTestA1.hap->/data/test/bmsThirdBundleTestA1.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/test/*.hap" + ] + } + ] +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/package.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..87f1191728fe1e5e19baa61f6756b06aa9b7c21f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.actsbmsallshortcutinfotest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsbmsallshortcutinfotest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home", + "flag.home.intent.from.system" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsbmsallshortcutinfotest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3c9388608d381925c9952fc0cb651e9aa3428c26 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: 'Test Shortcut' + }, + onInit() { + this.title = this.data.title; + }, + onShow() { + console.info('onReady finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + }, + onBackPress(){ + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9098ff6185ad2b33ac3fe714e7009f9273b38c95 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "actsbmsallshortcutinfotest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..8ca34a45f1be1237803d97acb3b86351472448fa --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsBmsAllShortcutInfoTest', function () { + /* + * @tc.number: bms_getAllShortcutInfo_0100 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut information of the hap with type of entry + */ + it('bms_getAllShortcutInfo_0100', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0100=================='); + var bundlePath = ['/data/test/bmsThirdBundleTest1.hap']; + await install(bundlePath); + var bundleName = 'com.example.third1'; + bundle.getAllShortcutInfo(bundleName).then((data) => { + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(1); + checkShortcutIsExist(data, 'id.third1', 'third1'); + done(); + }); + }); + /* + * @tc.number: bms_getAllShortcutInfo_0200 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut information of the hap with type of entry + */ + it('bms_getAllShortcutInfo_0200', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0200=================='); + var bundleName = 'com.example.third1'; + bundle.getAllShortcutInfo(bundleName, (result, data) => { + expect(result.code).assertEqual(0); + expect(data.length).assertEqual(1); + checkShortcutIsExist(data, 'id.third1', 'third1'); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_0300 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: 1.install a hap with type of feature + * 1.get the shortcut informations of two types of hap + */ + it('bms_getAllShortcutInfo_0300', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0300=================='); + var bundleName = 'com.example.third1'; + var bundlePath = ['/data/test/bmsThirdBundleTest3.hap']; + await install(bundlePath); + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(2); + checkShortcutIsExist(data, 'id.third1', 'third1'); + checkShortcutIsExist(data, 'id.third3', 'third3'); + done(); + }) + + /* + * @tc.number: bms_getAllShortcutInfo_0400 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: 1.get the shortcut informations of two types of hap + */ + it('bms_getAllShortcutInfo_0400', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0400=================='); + var bundleName = 'com.example.third1'; + bundle.getAllShortcutInfo(bundleName, async (result, data) => { + expect(result.code).assertEqual(0); + expect(data.length).assertEqual(2); + checkShortcutIsExist(data, 'id.third1', 'third1'); + checkShortcutIsExist(data, 'id.third3', 'third3'); + await uninstall(bundleName); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_0500 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut informations of an invalid hap + */ + it('bms_getAllShortcutInfo_0500', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0500=================='); + var data = await bundle.getAllShortcutInfo(''); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(0); + done(); + }) + /* + * @tc.number: bms_getAllShortcutInfo_0600 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut informations of an invalid hap + */ + it('bms_getAllShortcutInfo_0600', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0600=================='); + var bundleName = ''; + bundle.getAllShortcutInfo(bundleName, (result, data) => { + expect(result.code).assertEqual(-1); + expect(data.length).assertEqual(0); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_0700 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: 1.install a hap with low version + * 2.install a hap with high version + * 3.get the shortcut information of a hap with high version by bundlename + */ + it('bms_getAllShortcutInfo_0700', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0700=================='); + var bundlePath1 = ['/data/test/bmsThirdBundleTest1.hap']; + await install(bundlePath1); + var bundleName = 'com.example.third1'; + var bundlePath2 = ['/data/test/bmsThirdBundleTestA1.hap']; + await install(bundlePath2); + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(1); + for (var i = 0; i < data.length; i++) { + expect(typeof data[i]).assertEqual('object'); + expect(typeof data[i].id).assertEqual('string'); + expect(data[i].id).assertEqual('id.thirdA1'); + expect(typeof data[i].disableMessage).assertEqual('string'); + expect(typeof data[i].isStatic).assertEqual('boolean'); + expect(typeof data[i].isHomeShortcut).assertEqual('boolean'); + expect(typeof data[i].isEnabled).assertEqual('boolean'); + expect(typeof data[i].hostAbility).assertEqual('string'); + expect(typeof data[i].wants).assertEqual('object') + if (typeof data[i].wants != 'undefined' && Object.keys(data[i].wants).length != 0) { + for (var j = 0; j < data[i].wants.length; j++) { + expect(data[i].wants[j].targetClass).assertEqual('com.example.third1.AMainAbility'); + expect(data[i].wants[j].targetBundle).assertEqual('com.example.third1'); + } + } + } + done(); + }) + /* + * @tc.number: bms_getAllShortcutInfo_0800 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut information of a hap with high version by bundlename + */ + it('bms_getAllShortcutInfo_0800', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0800=================='); + var bundleName = 'com.example.third1'; + bundle.getAllShortcutInfo(bundleName, async (result, data) => { + expect(result.code).assertEqual(0); + expect(data.length).assertEqual(1); + for (var i = 0; i < data.length; i++) { + expect(typeof data[i]).assertEqual('object'); + expect(typeof data[i].id).assertEqual('string'); + expect(data[i].id).assertEqual('id.thirdA1'); + expect(typeof data[i].disableMessage).assertEqual('string'); + expect(typeof data[i].isStatic).assertEqual('boolean'); + expect(typeof data[i].isHomeShortcut).assertEqual('boolean'); + expect(typeof data[i].isEnabled).assertEqual('boolean'); + expect(typeof data[i].hostAbility).assertEqual('string'); + expect(typeof data[i].wants).assertEqual('object') + if (typeof data[i].wants != 'undefined' && Object.keys(data[i].wants).length != 0) { + for (var j = 0; j < data[i].wants.length; j++) { + expect(data[i].wants[j].targetClass).assertEqual('com.example.third1.AMainAbility'); + expect(data[i].wants[j].targetBundle).assertEqual('com.example.third1'); + } + } + } + await uninstall(bundleName); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_0900 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut information of a hap without shortcut in config.json + */ + it('bms_getAllShortcutInfo_0900', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_0900=================='); + var bundleName = 'com.example.third2'; + var bundlePath = ['/data/test/bmsThirdBundleTest2.hap']; + await install(bundlePath); + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(0); + done(); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1000 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut information of a hap without shortcut in config.json + */ + it('bms_getAllShortcutInfo_1000', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1000=================='); + var bundleName = 'com.example.third2'; + bundle.getAllShortcutInfo(bundleName, async (result, data) => { + expect(result.code).assertEqual(0); + expect(data.length).assertEqual(0); + await uninstall(bundleName); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1100 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut information of a system hap + */ + it('bms_getAllShortcutInfo_1100', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1100=================='); + var bundleName = 'com.example.system1'; + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(1); + checkShortcutIsExist(data, 'id.system1', 'system1'); + done(); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1200 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut information of a system hap + */ + it('bms_getAllShortcutInfo_1200', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1200=================='); + var bundleName = 'com.example.system1'; + bundle.getAllShortcutInfo(bundleName, (result, data) => { + expect(result.code).assertEqual(0); + expect(data.length).assertEqual(1); + checkShortcutIsExist(data, 'id.system1', 'system1'); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1300 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut information of a vendor hap + */ + it('bms_getAllShortcutInfo_1300', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1300=================='); + var bundleName = 'com.example.vendor1'; + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(1); + checkShortcutIsExist(data, 'id.vendor1', 'vendor1'); + done(); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1400 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut information of a vendor hap + */ + it('bms_getAllShortcutInfo_1400', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1400=================='); + var bundleName = 'com.example.vendor1'; + bundle.getAllShortcutInfo(bundleName, (result, data) => { + expect(result.code).assertEqual(0); + expect(data.length).assertEqual(1); + checkShortcutIsExist(data, 'id.vendor1', 'vendor1'); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1500 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: 1.install a normal hap + * 2.get the shortcut information of this hap by bundlename + * 3.get the shortcut information of this hap after uninstalling the hap + */ + it('bms_getAllShortcutInfo_1500', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1500=================='); + var bundlePath = ['/data/test/bmsThirdBundleTest1.hap']; + await install(bundlePath); + var bundleName = 'com.example.third1'; + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(1); + checkShortcutIsExist(data, 'id.third1', 'third1'); + await uninstall(bundleName); + var info = await bundle.getAllShortcutInfo(bundleName); + expect(info.length).assertEqual(0); + done(); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1600 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut information of this hap after uninstalling the hap + */ + it('bms_getAllShortcutInfo_1600', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1600==================');; + var bundleName = 'com.example.third1'; + bundle.getAllShortcutInfo(bundleName, (result, data) => { + expect(result.code).assertEqual(-1); + expect(data.length).assertEqual(0); + done(); + }); + }) + + /* + * @tc.number: bms_getAllShortcutInfo_1700 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut informations of this hap with two shortcuts in config.json by bundlename + */ + it('bms_getAllShortcutInfo_1700', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1700=================='); + var bundleName = 'com.example.third4'; + var bundlePath = ['/data/test/bmsThirdBundleTest4.hap']; + await install(bundlePath); + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(2); + checkShortcutIsExist(data, 'id.third4A', 'third4A'); + checkShortcutIsExist(data, 'id.third4B', 'third4B'); + done(); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1800 + * @tc.name: test getAllShortcutInfo with callback + * @tc.desc: get the shortcut informations of this hap with two shortcuts in config.json by bundlename + */ + it('bms_getAllShortcutInfo_1800', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1800=================='); + var bundleName = 'com.example.third4'; + bundle.getAllShortcutInfo(bundleName, async (result, data) => { + expect(result.code).assertEqual(0); + expect(data.length).assertEqual(2); + checkShortcutIsExist(data, 'id.third4A', 'third4A'); + checkShortcutIsExist(data, 'id.third4B', 'third4B'); + await uninstall(bundleName); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_1900 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut informations of an invalid bundleName + */ + it('bms_getAllShortcutInfo_1900', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_1900=================='); + var bundleName = '!@#$%^&ERTYUhusdf7254_=-'; + bundle.getAllShortcutInfo(bundleName).then((data) => { + expect(data.length).assertEqual(0); + done(); + }); + }) + /* + * @tc.number: bms_getAllShortcutInfo_2000 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut informations of an invalid bundleName + */ + it('bms_getAllShortcutInfo_2000', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_2000=================='); + var bundleName = '!@#$%^&ERTYUhusdf7254_=-'; + bundle.getAllShortcutInfo(bundleName, async (result, data) => { + expect(result.code).assertEqual(-1); + expect(data.length).assertEqual(0); + done(); + }); + }) + + /* + * @tc.number: bms_getAllShortcutInfo_2100 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut informations of an invalid long bundleName + */ + it('bms_getAllShortcutInfo_2100', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_2100=================='); + var bundleName = 'test'; + for(var i = 0; i < 10000; i++){ + bundleName += 'test'; + } + var data = await bundle.getAllShortcutInfo(bundleName); + expect(typeof data).assertEqual('object'); + expect(data.length).assertEqual(0); + done(); + }) + + /* + * @tc.number: bms_getAllShortcutInfo_2200 + * @tc.name: test getAllShortcutInfo with promise + * @tc.desc: get the shortcut informations of an invalid long bundleName + */ + it('bms_getAllShortcutInfo_2200', 0, async function (done) { + console.info('=====================bms_getAllShortcutInfo_2200=================='); + var bundleName = 'test'; + for(var i = 0; i < 10000; i++){ + bundleName += 'test'; + } + bundle.getAllShortcutInfo(bundleName, async (result, data) => { + expect(result.code).assertEqual(-1); + expect(data.length).assertEqual(0); + done(); + }); + }) + + function checkShortcutInfo(dataInfo, name) { + console.info('=======Shortcut Info========' + JSON.stringify(dataInfo)) + console.info('=============Shortcutid=========' + dataInfo.id); + expect(typeof dataInfo.id).assertEqual('string'); + expect(dataInfo.id).assertEqual('id.' + name); + console.info('=============icon==============' + JSON.stringify(dataInfo.icon)); + expect(typeof dataInfo.disableMessage).assertEqual('string'); + expect(typeof dataInfo.isStatic).assertEqual('boolean'); + expect(typeof dataInfo.isHomeShortcut).assertEqual('boolean'); + expect(typeof dataInfo.isEnabled).assertEqual('boolean'); + expect(typeof dataInfo.hostAbility).assertEqual('string'); + console.info('=============label==============' + JSON.stringify(dataInfo.label)); + expect(typeof dataInfo.wants).assertEqual('object'); + if (typeof dataInfo.wants != 'undefined' && Object.keys(dataInfo.wants).length != 0) { + expect(dataInfo.wants.length).assertLarger(0); + for (var j = 0; j < dataInfo.wants.length; j++) { + console.info('=============targetClass==============' + JSON.stringify(dataInfo.wants[j].targetClass)); + expect(dataInfo.wants[j].targetClass).assertEqual('com.example.' + name + '.MainAbility'); + console.info('=============targetBundle==============' + JSON.stringify(dataInfo.wants[j].targetBundle)); + expect(dataInfo.wants[j].targetBundle).assertEqual('com.example.' + name); + } + } + } + + async function install(bundlePath) { + let result = await bundle.getBundleInstaller(); + await result.install(bundlePath, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, OnReceiveInstallEvent); + + function OnReceiveInstallEvent(err, data) { + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + }; + } + async function uninstall(bundleName) { + let result = await bundle.getBundleInstaller(); + await result.uninstall(bundleName, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, OnReceiveUninstallEvent); + + function OnReceiveUninstallEvent(err, data) { + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + }; + } + + function checkShortcutIsExist(dataInfo, shortcutId, testName) { + let info = new Map(); + for (var i = 0, len = dataInfo.length; i < len; i++) { + expect(typeof dataInfo[i]).assertEqual('object'); + info.set(dataInfo[i].id, dataInfo[i]); + } + expect(info.has(shortcutId)).assertTrue(); + if (info.has(shortcutId)) { + checkShortcutInfo(info.get(shortcutId), testName); + } + } +}) \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/List.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..3a82aa5c612f5256f96974f0eb33945af7d5aa47 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/List.test.js @@ -0,0 +1,16 @@ +/* + * 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. + */ + +require('./ActsBmsAllShortcutInfoTest.test.js') \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..4650bd3c48738ad6dc6b0fb22c4f5478f1c4f212 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsBmsCheckPermissionTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBmsCheckPermissionTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..44a4c911336b67a990cb95423083360aa2e0b581 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "21600000", + "package": "com.example.actsbmscheckpermissiontest", + "shell-timeout": "21600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsBmsCheckPermissionTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/package.json b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..cc30895977c2c079594f131d31ff516da1984371 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/config.json @@ -0,0 +1,96 @@ +{ + "app": { + "bundleName": "com.example.actsbmscheckpermissiontest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsbmscheckpermissiontest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsbmscheckpermissiontest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + + "defPermissions": [ + { + "name": "com.permission.CAMERA", + "grantMode": "user_grant", + "availableScope": ["signature"] + }, + { + "name": "com.permission.PERMISSION_A", + "grantMode": "system_grant", + "availableScope": ["signature"] + } + ], + "reqPermissions": [ + { + "name": "com.permission.CAMERA", + "reason": "Need open camera", + "usedScene": { + "ability": [ + "com.example.permissionchange.MainAbility" + ], + "when": "always" + } + }, + { + "name": "com.permission.PERMISSION_A", + "reason": "Need PERMISSION_A", + "usedScene": { + "ability": [ + "com.example.permissionchange.MainAbility" + ], + "when": "always" + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2ba842eda9d2f61221fca73dfb53c2a2903fc3e4 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3a1c06c29609175ed1aa683ef5c7621f8607c54d --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: 'Test CheckPermission' + }, + onInit() { + this.title = this.data.title; + }, + onShow() { + console.info('onReady finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..96c4547ae5de41ce0476e183329237e88ae0fbe6 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "actsbmscheckpermissiontest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..9cab7e56d25a189bf42de5af959c1e156537ce5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +const BUNDLE_NAME = 'com.example.actsbmscheckpermissiontest'; +const PERMISSION_ONE = 'com.permission.CAMERA'; +const PERMISSION_TWO = 'com.permission.PERMISSION_A'; + +describe('ActsBmsCheckPermissionTest', function () { + /* + * @tc.number: bms_checkPermission_0100 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whose availableScope is system_grant whether is granted. (by promise) + */ + it('bms_checkPermission_0100', 0, async function (done) { + console.info('=====================bms_checkPermission_0100=================='); + var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO) + expect(data).assertEqual(0); + done(); + }) + /* + * @tc.number: bms_checkPermission_0200 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whose availableScope is system_grant whether is granted. (by callback) + */ + it('bms_checkPermission_0200', 0, async function (done) { + console.info('=====================bms_checkPermission_0200=================='); + await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO, (err, data) => { + expect(err.code).assertEqual(0); + expect(data).assertEqual(0); + done(); + }) + }) + /* + * @tc.number: bms_checkPermission_0300 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the bundleName is invalid. (by promise) + */ + it('bms_checkPermission_0300', 0, async function (done) { + console.info('=====================bms_checkPermission_0300=================='); + var data = await bundle.checkPermission('', PERMISSION_ONE) + expect(data).assertEqual(-1); + done(); + }) + /* + * @tc.number: bms_checkPermission_0400 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the bundleName is invalid. (by callback) + */ + it('bms_checkPermission_0400', 0, async function (done) { + console.info('=====================bms_checkPermission_0400=================='); + await bundle.checkPermission('', PERMISSION_ONE, (err, data) => { + expect(err.code).assertEqual(-1); + expect(data).assertEqual(-1); + done(); + }) + }) + /* + * @tc.number: bms_checkPermission_0500 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the permissionName is invalid. (by promise) + */ + it('bms_checkPermission_0500', 0, async function (done) { + console.info('=====================bms_checkPermission_0500=================='); + var data = await bundle.checkPermission(BUNDLE_NAME, '') + expect(data).assertEqual(-1); + done(); + }) + /* + * @tc.number: bms_checkPermission_0600 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the permissionName is invalid. (by callback) + */ + it('bms_checkPermission_0600', 0, async function (done) { + console.info('=====================bms_checkPermission_0600=================='); + await bundle.checkPermission(BUNDLE_NAME, '', (err, data) => { + expect(err.code).assertEqual(-1); + expect(data).assertEqual(-1); + done(); + }) + }) + /* + * @tc.number: bms_checkPermission_0700 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the permissionName is invalid. (by promise) + */ + it('bms_checkPermission_0700', 0, async function (done) { + console.info('=====================bms_checkPermission_0700=================='); + var data = await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345') + expect(data).assertEqual(-1); + done(); + }) + + /* + * @tc.number: bms_checkPermission_0800 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the permissionName is invalid. (by callback) + */ + it('bms_checkPermission_0800', 0, async function (done) { + console.info('=====================bms_checkPermission_0800=================='); + await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345', (err, data) => { + expect(err.code).assertEqual(-1); + expect(data).assertEqual(-1); + done(); + }) + }) + /* + * @tc.number: bms_checkPermission_0900 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the bundleName is invalid. (by callback) + */ + it('bms_checkPermission_0900', 0, async function (done) { + console.info('=====================bms_checkPermission_0900=================='); + var data = await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE) + expect(data).assertEqual(-1); + done(); + }) + /* + * @tc.number: bms_checkPermission_1000 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the bundleName is invalid. (by callback) + */ + it('bms_checkPermission_1000', 0, async function (done) { + console.info('=====================bms_checkPermission_1000=================='); + await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE, (err, data) => { + expect(err.code).assertEqual(-1); + expect(data).assertEqual(-1); + done(); + }) + }) + /* + * @tc.number: bms_checkPermission_1100 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the permissionName is invalid. (by promise) + */ + it('bms_checkPermission_1100', 0, async function (done) { + console.info('=====================bms_checkPermission_1100=================='); + var permissionName = 'test'; + for (var i = 0; i < 10000; i++) { + permissionName += 'test'; + } + var data = await bundle.checkPermission(BUNDLE_NAME, permissionName) + expect(data).assertEqual(-1); + done(); + }) + + /* + * @tc.number: bms_checkPermission_1200 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the permissionName is invalid. (by callback) + */ + it('bms_checkPermission_1200', 0, async function (done) { + console.info('=====================bms_checkPermission_1200=================='); + var permissionName = 'test'; + for (var i = 0; i < 10000; i++) { + permissionName += 'test'; + } + await bundle.checkPermission(BUNDLE_NAME, permissionName, (err, data) => { + expect(err.code).assertEqual(-1); + expect(data).assertEqual(-1); + done(); + }) + }) + /* + * @tc.number: bms_checkPermission_1300 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the bundleName is invalid. (by promise) + */ + it('bms_checkPermission_1300', 0, async function (done) { + console.info('=====================bms_checkPermission_1300=================='); + var bundleName = 'test'; + for (var i = 0; i < 10000; i++) { + bundleName += 'test'; + } + var data = await bundle.checkPermission(bundleName, PERMISSION_ONE) + expect(data).assertEqual(-1); + done(); + }) + /* + * @tc.number: bms_checkPermission_1400 + * @tc.name: check whether the permission is granted + * @tc.desc: verify the requested permission whether is granted, which by calling the checkpermission + * function and the bundleName is invalid. (by callback) + */ + it('bms_checkPermission_1400', 0, async function (done) { + console.info('=====================bms_checkPermission_1400=================='); + var bundleName = 'test'; + for (var i = 0; i < 10000; i++) { + bundleName += 'test'; + } + await bundle.checkPermission(bundleName, PERMISSION_ONE, (err, data) => { + expect(err.code).assertEqual(-1); + expect(data).assertEqual(-1); + done(); + }) + }) +}) \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/List.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..3133f8c36285ff3d225c6c6175572ebf1f541774 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/List.test.js @@ -0,0 +1,16 @@ +/* + * 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. + */ + +require('./ActsBmsCheckPermissionTest.test.js') \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a938d9d75979d65bab83e1db6ae1a897f3dadd7a --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsBmsHapModuleTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBmsHapModuleTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..0c599de01fdecde2070a385d955fd3e60cebee4f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/Test.json @@ -0,0 +1,39 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "21600000", + "package": "com.example.actsbmshapmoduletest", + "shell-timeout": "21600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsBmsHapModuleTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount", + "mkdir /data/test" + ] + }, + { + "type": "PushKit", + "push": [ + "bmsMainAbilityFirstScene.hap.hap->/data/test/bmsMainAbilityFirstScene.hap", + "bmsMainAbilitySecondScene.hap->/data/test/bmsMainAbilitySecondScene.hap", + "bmsThirdBundleTest2.hap->/data/test/bmsThirdBundleTest2.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/test/*.hap" + ] + } + ] +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/package.json b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..cfd5070282ac8e7bf5f3145bf29e7c7845f72aaa --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.actsbmshapmoduletest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsbmshapmoduletest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home", + "flag.home.intent.from.system" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsbmshapmoduletest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..28edb2a10002bb2fc8b086f5d382c2984c12ac2e --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: 'Test HapModuleInfo' + }, + onInit() { + this.title = this.data.title; + }, + onShow() { + console.info('onReady finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..57c477c3cefe40772c5a1a69fb3dd92e082a8252 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "actsbmshapmoduletest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..0f41354e27b2925da3aa86533b817a6118b41a6e --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +describe('ActsBmsHapModuleTest', function () { + /* + * @tc.number: bms_getHapModuleInfo_0100 + * @tc.name: get hapModuleInfo from one app by getBundleInfo + * @tc.desc: get the module information of the hap with type of entry + */ + it('bms_getHapModuleInfo_0100', 0, async function (done) { + console.debug('===========begin bms_getHapModuleInfo_0100===========') + await install(['/data/test/bmsMainAbilityFirstScene.hap']); + let bundleName = 'com.example.bmsmainabilityfirstscene'; + bundle.getBundleInfo(bundleName, 1, callback); + + function callback(err, data) { + console.debug('=======get bundle========' + JSON.stringify(data)); + let hapModuleInfo = data.hapModuleInfo[0]; + console.debug('=======get hapModule========' + JSON.stringify(hapModuleInfo)) + console.debug('=======get hapModule mainAbilityName========' + hapModuleInfo.mainAbilityName) + expect(hapModuleInfo.moduleName).assertEqual('entry'); + expect(hapModuleInfo.mainAbilityName).assertEqual('com.example.bmsmainabilityfirstscene.MainAbility'); + checkHapModuleInfo(hapModuleInfo); + done(); + } + }); + + + /* + * @tc.number: bms_getHapModuleInfo_0200 + * @tc.name: get hapModuleInfo from two modules by getBundleInfo + * @tc.desc: get the module information of the hap with type of feature + */ + it('bms_getHapModuleInfo_0200', 0, async function (done) { + console.debug('===========begin bms_getHapModuleInfo_0200===========') + await install(['/data/test/bmsMainAbilitySecondScene.hap']); + let bundleName = 'com.example.bmsmainabilityfirstscene'; + let firstMainAbility = 'com.example.bmsmainabilityfirstscene.MainAbility'; + let secondMainAbility = 'com.example.bmsmainabilitysecondscene.MainAbility'; + let result = new Map(); + bundle.getBundleInfo(bundleName, 1, async (err, data) => { + console.debug('=======hapModule length========' + data.hapModuleInfo.length); + expect(data.hapModuleInfo.length).assertEqual(2); + for (let i = 0, len = data.hapModuleInfo.length;i < len; i++) { + console.debug('=======get hapModule========' + JSON.stringify(data.hapModuleInfo[i])) + console.debug('=======get hapModule mainAbilityName========' + data.hapModuleInfo[i].mainAbilityName); + checkHapModuleInfo(data.hapModuleInfo[i]); + result.set(data.hapModuleInfo[i].mainAbilityName, data.hapModuleInfo[i]); + } + expect(result.has(firstMainAbility)).assertTrue(); + expect(result.has(secondMainAbility)).assertTrue(); + expect(result.get(firstMainAbility).moduleName).assertEqual('entry'); + expect(result.get(secondMainAbility).moduleName).assertEqual('bmsmainabilitysecondscene'); + await uninstall(bundleName); + done(); + }) + }) + + /* + * @tc.number: bms_getHapModuleInfo_0300 + * @tc.name: get hapModuleInfo one app without mainAbility by getBundleInfo + * @tc.desc: get the module information of the hap without mainAbility + */ + it('bms_getHapModuleInfo_0300', 0, async function (done) { + console.debug('===========begin bms_getHapModuleInfo_0300===========') + await install(['/data/test/bmsThirdBundleTest2.hap']); + let bundleName = 'com.example.third2'; + bundle.getBundleInfo(bundleName, 1).then(async (data) => { + console.debug('=======get hapModule========' + JSON.stringify(data)) + expect(data.hapModuleInfo.length).assertEqual(1); + console.debug('=======get hapModule mainAbilityName========' + data.hapModuleInfo[0].mainAbilityName) + expect(data.hapModuleInfo[0].mainAbilityName).assertEqual(''); + expect(data.hapModuleInfo[0].moduleName).assertEqual('entry'); + checkHapModuleInfo(data.hapModuleInfo[0]); + await uninstall(bundleName); + done(); + }) + }) + + function checkHapModuleInfo(dataInfo) { + console.debug('========begin check hapModuleInfo========') + expect(typeof dataInfo.name).assertEqual('string'); + expect(typeof dataInfo.description).assertEqual('string'); + expect(typeof dataInfo.descriptionId).assertEqual('number'); + expect(typeof dataInfo.icon).assertEqual('string'); + expect(typeof dataInfo.label).assertEqual('string'); + expect(typeof dataInfo.labelId).assertEqual('number'); + expect(typeof dataInfo.iconId).assertEqual('number'); + expect(typeof dataInfo.backgroundImg).assertEqual('string'); + expect(typeof dataInfo.supportedModes).assertEqual('number'); + expect(typeof dataInfo.reqCapabilities).assertEqual('object'); + expect(typeof dataInfo.deviceTypes).assertEqual('object'); + expect(typeof dataInfo.abilityInfo).assertEqual('object'); + expect(typeof dataInfo.moduleName).assertEqual('string'); + expect(typeof dataInfo.mainAbilityName).assertEqual('string'); + expect(typeof dataInfo.installationFree).assertEqual('boolean'); + } + + async function install(bundlePath) + { + var installer = await bundle.getBundleInstaller(); + await installer.install(bundlePath, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveInstallEvent); + + function onReceiveInstallEvent(err, data) { + console.info('========install Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + } + + async function uninstall(bundleName) + { + var installer = await bundle.getBundleInstaller(); + await installer.uninstall(bundleName, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveUninstallEvent); + + function onReceiveUninstallEvent(err, data) { + console.info('========uninstall Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + } + +}) \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/List.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..86c7650fc9be0a52c07bcdd117d67387c2e5ef2e --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/List.test.js @@ -0,0 +1,16 @@ +/* + * 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. + */ + +require('./ActsBmsHapModuleTest.test.js') \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..bdde22de28ae56b33677d28b1c5ddf703e5b01a4 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsBmsJsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBmsJsTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..af8f9d8052ad997da464f99d211211893323ed05 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/Test.json @@ -0,0 +1,39 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "21600000", + "package": "com.example.actsbmsjstest", + "shell-timeout": "21600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsBmsJsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount", + "mkdir /data/test" + ] + }, + { + "type": "PushKit", + "push": [ + "bmsThirdBundleTest2.hap->/data/test/bmsThirdBundleTest2.hap", + "bmsThirdBundleTest5.hap->/data/test/bmsThirdBundleTest5.hap", + "bmsThirdBundleJs.hap->/data/test/bmsThirdBundleJs.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/test/*.hap" + ] + } + ] +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/package.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7c7ab34ad291d83719f603bdfe593a3c4593de --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/config.json @@ -0,0 +1,63 @@ +{ + "app": { + "bundleName": "com.example.actsbmsjstest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsbmsjstest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home", + "flag.home.intent.from.system" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true, + "srcPath": "default" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..66a83f6217358f0f9a5ad6d2078868befdc8a19f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 50px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1dab932fdbf0cceefe75e41071f9402cdd7edf4a --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "Test Multi Js Ability" + }, + onInit() { + this.title = this.data.title; + }, + onShow() { + }, + onReady() { + console.info('onShow finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + require('../../../test/List.test') + core.execute() + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..25412fb113cadbdefd605e8c49a7c94e45c0f498 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "actsbmsjstest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..c59363cd22e484de88f384a1d56113bbfe3f7fe7 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import bundle from '@ohos.bundle' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +describe('ActsBmsJsTest', function () { + /* + * @tc.number: bms_getJsAbility_0100 + * @tc.name: test the multi js ability + * @tc.desc: 1.install a js hap which has an ability with full domain name + * 2.check the ability name by the interface of getBundleInfo + */ + it('bms_getJsAbility_0100', 0, async function (done) { + console.info('=====================bms_getJsAbility_0100=================='); + let bundleName = 'com.example.third2'; + let abilityName = 'com.example.third2.MainAbility'; + await install(['/data/test/bmsThirdBundleTest2.hap']); + bundle.getBundleInfo(bundleName,1).then((data)=>{ + expect(data.abilityInfo.length).assertEqual(1); + checkIsExist(abilityName, data); + uninstall(bundleName); + done(); + }); + }) + /* + * @tc.number: bms_getJsAbility_0200 + * @tc.name: test the multi js ability + * @tc.desc: 1.install a js hap with two ability + * 2.check the ability name by the interface of getBundleInfo + */ + it('bms_getJsAbility_0200', 0, async function (done) { + console.info('=====================bms_getJsAbility_0200=================='); + var bundleName = 'com.example.third5'; + let abilityName1 = 'com.example.third5.AMainAbility'; + let abilityName2 = 'com.example.third5.BMainAbility'; + await install(['/data/test/bmsThirdBundleTest5.hap']); + bundle.getBundleInfo(bundleName,1).then((data)=>{ + console.debug('==========bundleInfo==========' + JSON.stringify(data)) + expect(data.abilityInfo.length).assertLarger(1); + checkIsExist(abilityName1, data); + checkIsExist(abilityName2, data); + uninstall(bundleName); + done(); + }); + }) + /* + * @tc.number: bms_getJsAbility_0300 + * @tc.name: test the multi js ability + * @tc.desc: 1.install a js hap which has an ability with short domain name + * 2.check the ability name by the interface of getBundleInfo + */ + it('bms_getJsAbility_0300', 0, async function (done) { + console.info('=====================bms_getJsAbility_0300=================='); + let bundleName = 'com.example.js'; + let abilityName = 'com.example.js.MainAbility'; + await install(['/data/test/bmsThirdBundleJs.hap']); + bundle.getBundleInfo(bundleName,1).then((data)=>{ + expect(data.abilityInfo.length).assertEqual(1); + checkIsExist(abilityName, data); + uninstall(bundleName); + done(); + }); + }) + async function install(bundlePath) + { + var installer = await bundle.getBundleInstaller(); + await installer.install(bundlePath, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveInstallEvent); + + function onReceiveInstallEvent(err, data) { + console.info('========install Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + } + async function uninstall(bundleName) + { + var installer = await bundle.getBundleInstaller(); + await installer.uninstall(bundleName, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveUninstallEvent); + + function onReceiveUninstallEvent(err, data) { + console.info('========uninstall Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + } + function checkIsExist(abilityName, data) + { + console.debug('==========bundleInfo==========' + JSON.stringify(data)) + console.debug('==========AbilityInfo===========' + JSON.stringify(data.abilityInfo)) + let abilityNames = new Map(); + for (var i = 0; i < data.abilityInfo.length; i++) + { + console.debug('==========abilityName==========' + data.abilityInfo[i].name); + abilityNames.set(data.abilityInfo[i].name, data.abilityInfo[i]); + } + expect(abilityNames.has(abilityName)).assertEqual(true); + } +}) \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/List.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..6cadb5202494955ee09a6ee0046db814275d4324 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * 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. + */ +require('./ActsBmsJsTest.test.js') \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..47b9d717fd23bc84a2430e7b757ffc220026f12d --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsBmsMetaDataTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBmsMetaDataTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..990fe169fa7be084037a3079c1bab1d9d9bb5bb0 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/Test.json @@ -0,0 +1,40 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "21600000", + "package": "com.example.actsbmsmetadatatest", + "shell-timeout": "21600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsBmsMetaDataTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount", + "mkdir /data/test" + ] + }, + { + "type": "PushKit", + "push": [ + "bmsThirdBundleTest1.hap->/data/test/bmsThirdBundleTest1.hap", + "bmsThirdBundleTest3.hap->/data/test/bmsThirdBundleTest3.hap", + "bmsThirdBundleTest5.hap->/data/test/bmsThirdBundleTest5.hap", + "bmsThirdBundleTestA1.hap->/data/test/bmsThirdBundleTestA1.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/test/*.hap" + ] + } + ] +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/package.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..66d62562a06865fa730c72aaaf736fae9845e8c2 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.actsbmsmetadatatest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsbmsmetadatatest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home", + "flag.home.intent.from.system" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsbmsmetadatatest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..99c9497cd2046a0f71e18678b2d82c36ff57add7 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: 'Test MetaData' + }, + onInit() { + this.title = this.data.title; + }, + onShow() { + console.info('onReady finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + }, + onBackPress(){ + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e6b09b2876ca224350c3065b7cf6117171abe2ad --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "actsbmsmetadatatest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..8621a13a96543c6c82ec911717f9490abcbd6ebe --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsBmsMetaDataTest', function () { + /* + * @tc.number: bms_getMetaData_0100 + * @tc.name: test to get meta data for an application. + * @tc.desc: get an application's meta data which contains two HAP packages. + */ + it('bms_getMetaData_0100', 0, async function (done) { + console.info('=====================bms_getMetaData_0100=================='); + await install(['/data/test/bmsThirdBundleTest1.hap']) + await install(['/data/test/bmsThirdBundleTest3.hap']) + var datainfo = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.third1', + abilityName: 'com.example.third1.MainAbility', + }, + } + }, 0, 0) + checkMetaData(datainfo.metaData); + datainfo = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.third1', + abilityName: 'com.example.third3.MainAbility', + }, + } + }, 0, 0) + checkMetaData(datainfo.metaData); + done(); + }) + /* + * @tc.number: bms_getMetaData_0200 + * @tc.name: test to get meta data for an update application. + * @tc.desc: get an application's meta data that is updated. + */ + it('bms_getMetaData_0200', 0, async function (done) { + console.info('=====================bms_getMetaData_0200=================='); + await install(['/data/test/bmsThirdBundleTestA1.hap']) + var datainfo = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.third1', + abilityName: 'com.example.third1.AMainAbility', + }, + } + }, 0, 0) + checkMetaData(datainfo.metaData); + done(); + }) + /* + * @tc.number: bms_getMetaData_0300 + * @tc.name: test to get meta data for an uninstalled application. + * @tc.desc: get an application's meta data that is uninstalled. + */ + it('bms_getMetaData_0300', 0, async function (done) { + console.info('=====================bms_getMetaData_0300=================='); + await uninstall('com.example.third1'); + var datainfo = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.third1', + abilityName: 'com.example.third1.MainAbility', + }, + } + }, 0, 0) + console.info('==========abilityInfo is ==========' + datainfo); + console.info('==========abilityInfo is ==========' + JSON.stringify(datainfo)); + checkMetaDataNoExit(datainfo.metaData); + done(); + }) + /* + * @tc.number: bms_getMetaData_0400 + * @tc.name: test to get meta data for an application. + * @tc.desc: get an application's meta data which has two abilities. + */ + it('bms_getMetaData_0400', 0, async function (done) { + console.info('=====================bms_getMetaData_0400=================='); + await install(['/data/test/bmsThirdBundleTest5.hap']); + var datainfo1 = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.third5', + abilityName: 'com.example.third5.AMainAbility', + }, + } + }, 0, 0) + console.info('==========abilityInfo is ==========' + JSON.stringify(datainfo1)); + checkMetaData(datainfo1.metaData); + var datainfo2 = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.third5', + abilityName: 'com.example.third5.BMainAbility', + }, + } + }, 0, 0) + console.info('==========abilityInfo is ==========' + JSON.stringify(datainfo2)); + checkMetaData(datainfo2.metaData); + uninstall('com.example.third5'); + done(); + }) + /* + * @tc.number: bms_getMetaData_0500 + * @tc.name: test to get meta data for an application that does not exist. + * @tc.desc: get an application's meta data which does not exist. + */ + it('bms_getMetaData_0500', 0, async function (done) { + console.info('=====================bms_getMetaData_0500=================='); + var datainfo = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.noexist', + abilityName: 'com.example.noexist.MainAbility', + }, + } + }, 0, 0) + console.info('==========abilityInfo is ==========' + datainfo); + console.info('==========abilityInfo is ==========' + JSON.stringify(datainfo)); + checkMetaDataNoExit(datainfo.metaData); + done(); + }) + /* + * @tc.number: bms_getMetaData_0600 + * @tc.name: test to get meta data for a system application. + * @tc.desc: get a system application's meta data. + */ + it('bms_getMetaData_0600', 0, async function (done) { + console.info('=====================bms_getMetaData_0600=================='); + var datainfo = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.system1', + abilityName: 'com.example.system1.MainAbility', + }, + } + }, 0, 0) + checkMetaData(datainfo.metaData); + done(); + }) + /* + * @tc.number: bms_getMetaData_0700 + * @tc.name: test to get meta data for a vendor application. + * @tc.desc: get a vendor application's meta data. + */ + it('bms_getMetaData_0700', 0, async function (done) { + console.info('=====================bms_getMetaData_0700=================='); + var datainfo = await bundle.queryAbilityByWant({ + want: { + action: 'action.system.home', + entities: ['entity.system.home'], + elementName: { + deviceId: '0', + bundleName: 'com.example.vendor1', + abilityName: 'com.example.vendor1.MainAbility', + }, + } + }, 0, 0) + checkMetaData(datainfo.metaData); + done(); + }) + + function checkMetaData(data) { + console.info('==========MetaData is==========' + JSON.stringify(data)); + var parameters = data.parameters; + var results = data.results; + var customizeDatas = data.customizeDatas; + expect(typeof parameters).assertEqual('object'); + expect(typeof results).assertEqual('object'); + expect(typeof customizeDatas).assertEqual('object'); + console.info('==========parameters.length is==========' + parameters.length); + console.info('==========results.length is==========' + results.length); + console.info('==========customizeDatas.length is==========' + customizeDatas.length); + expect(parameters.length).assertLarger(0); + expect(results.length).assertLarger(0); + expect(customizeDatas.length).assertLarger(0); + for (let i = 0; i < parameters.length; i++) { + console.info('==========Parameter description is==========' + parameters[i].description); + expect(typeof parameters[i].description).assertEqual('string'); + console.info('==========Parameter name is==========' + parameters[i].name); + expect(typeof parameters[i].name).assertEqual('string'); + console.info('==========Parameter type is==========' + parameters[i].type); + expect(typeof parameters[i].type).assertEqual('string'); + } + for (let i = 0; i < results.length; i++) { + console.info('==========Results description is==========' + results[i].description); + expect(typeof results[i].description).assertEqual('string'); + console.info('==========Results name is==========' + results[i].name); + expect(typeof results[i].name).assertEqual('string'); + console.info('==========Results type is==========' + results[i].type); + expect(typeof results[i].type).assertEqual('string'); + } + for (let i = 0; i < customizeDatas.length; i++) { + console.info('==========CustomizeData name is==========' + customizeDatas[i].name); + expect(typeof customizeDatas[i].name).assertEqual('string'); + console.info('==========CustomizeData value is==========' + customizeDatas[i].value); + expect(typeof customizeDatas[i].value).assertEqual('string'); + console.info('==========CustomizeData extra is==========' + customizeDatas[i].extra); + expect(typeof customizeDatas[i].extra).assertEqual('string'); + } + } + function checkMetaDataNoExit(data) { + console.info('==========MetaData is==========' + JSON.stringify(data)); + var parameters = data.parameters; + var results = data.results; + var customizeDatas = data.customizeDatas; + expect(typeof parameters).assertEqual('object'); + expect(typeof results).assertEqual('object'); + expect(typeof customizeDatas).assertEqual('object'); + expect(parameters.length).assertEqual(0); + expect(results.length).assertEqual(0); + expect(customizeDatas.length).assertEqual(0); + } + async function install(bundlePath) { + var installer = await bundle.getBundleInstaller(); + await installer.install(bundlePath, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveinstallEvent); + function onReceiveinstallEvent(err, data) { + console.info('========install Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + } + + async function uninstall(bundleName) { + var installer = await bundle.getBundleInstaller(); + await installer.uninstall(bundleName, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveinstallEvent); + function onReceiveinstallEvent(err, data) { + console.info('========uninstall Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + } +}) \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/List.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..4361f7e3091910e24c8a0769c366ef7f63440aa9 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * 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. + */ +require('./ActsBmsMetaDataTest.test.js') \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c2be08f8d3944830bf1d36e779d5566371a83f26 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsBmsModuleUsageRecordTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBmsModuleUsageRecordTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..9952c7577c7565f4a2530770743d9ac1dfa5d1f2 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/Test.json @@ -0,0 +1,37 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "21600000", + "package": "com.example.actsbmsmoduleusagerecordtest", + "shell-timeout": "21600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsBmsModuleUsageRecordTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount", + "mkdir /data/test" + ] + }, + { + "type": "PushKit", + "push": [ + "bmsThirdBundleTest1.hap->/data/test/bmsThirdBundleTest1.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/test/*.hap" + ] + } + ] +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/package.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..ed25424dc0c0364a1bb19da8780c39764527a2ad --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.actsbmsmoduleusagerecordtest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsbmsmoduleusagerecordtest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home", + "flag.home.intent.from.system" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsbmsmoduleusagerecordtest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "visible": true, + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..f4beb9efb5638d301bb3fbceed2db5342f83e276 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the 'License'); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an 'AS IS' BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..66a83f6217358f0f9a5ad6d2078868befdc8a19f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 50px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b6ed8c21b77e86aa8f0bb6fac847ed63ce56a744 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the 'License'); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an 'AS IS' BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "Test ModuleUsageRecord" + }, + onInit() { + this.title = this.data.title; + }, + onShow() { + console.info('onReady finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test.js') + core.execute() + }, + onReady() { + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..aa01804d458dad4e2d02bc41611b0d3c8484a0c3 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "actsbmsmoduleusagerecordtest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..1413a9f2c48a00b81b19735e99b088c8db5fc9b6 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js @@ -0,0 +1,355 @@ +/* +* Copyright (c) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the 'License'); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an 'AS IS' BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import bundle from '@ohos.bundle' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' +import featureAbility from '@ohos.ability.featureability' +import commonEvent from '@ohos.commonevent' + +const START_ABILITY_TIMEOUT = 5000; +const MIN_NUM = 2; +const MAX_NUM = 10; +const INVALID_NUM = -1; +var SubscriberInfo_bms_getModuleUsageRecordTest_0100 = { + events: ['ACTS_Third1_Publish_CommonEvent'], +}; +describe('ActsBmsModuleUsageRecordTest', function () { + beforeAll(async (done) => { + console.debug('=======before all install========'); + bundle.getBundleInstaller().then((data) => { + data.install(['/data/test/bmsThirdBundleTest1.hap'], { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveinstallEvent); + }) + function onReceiveinstallEvent(err, data) { + console.info('========install finish========' + JSON.stringify(err)); + console.info('========install finish========' + JSON.stringify(data)); + console.info('========install finish========' + data.status); + console.info('========install finish========' + data.statusMessage); + done() + } + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0100 + * @tc.name: getModuleUsageRecord(maxNum) + * @tc.desc: Use the getModuleUsageRecord interface to query the activation times and last + * activation time of ability + */ + it('bms_getModuleUsageRecordTest_0100', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0100=================='); + var bundleName = 'com.example.third1'; + var Subscriber; + let id; + async function SubscribeCallBack(err, data) { + clearTimeout(id); + expect(data.event).assertEqual('ACTS_Third1_Publish_CommonEvent'); + console.debug('====>Subscribe CallBack data:====>' + JSON.stringify(data)); + let records = await bundle.getModuleUsageRecords(MIN_NUM); + checkModuleUsageRecord(records, 'bms_getModuleUsageRecordTest_0100'); + var result = checkIsExist(records, bundleName); + expect(result).assertEqual(true); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + done(); + } + await commonEvent.createSubscriber(SubscriberInfo_bms_getModuleUsageRecordTest_0100).then(async (data) => { + console.debug('====>Create Subscriber====>'); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + function UnSubscribeCallback() { + console.debug('====>UnSubscribe CallBack====>'); + done(); + } + function timeout() { + expect().assertFail(); + console.debug('bms_getModuleUsageRecordTest_0100=====timeout======'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + done(); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug('=======start ability========') + let result = await featureAbility.startAbility( + { + want: + { + bundleName: 'com.example.third1', + abilityName: 'com.example.third1.MainAbility' + } + } + ) + expect(result).assertEqual(0); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0200 + * @tc.name: getModuleUsageRecord(maxNum) + * @tc.desc: When the number of starts of ability is less than maxNum, call interface getModuleUsageRecord + */ + it('bms_getModuleUsageRecordTest_0200', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0200=================='); + var bundleName = 'com.example.third1'; + bundle.getModuleUsageRecords(MIN_NUM, (err, data) => { + expect(err.code).assertEqual(0); + checkModuleUsageRecord(data, 'bms_getModuleUsageRecordTest_0200'); + var result = checkIsExist(data, bundleName); + expect(result).assertEqual(true); + done(); + }); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0300 + * @tc.name: getModuleUsageRecord(maxNum) + * @tc.desc: When the number of starts of ability is less than maxNum, call interface getModuleUsageRecord + */ + it('bms_getModuleUsageRecordTest_0300', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0300=================='); + var bundleName = 'com.example.third1'; + bundle.getModuleUsageRecords(MAX_NUM, (err, data) => { + expect(err.code).assertEqual(0); + checkModuleUsageRecord(data, 'bms_getModuleUsageRecordTest_0300'); + var result = checkIsExist(data, bundleName); + expect(result).assertEqual(true); + done(); + }); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0400 + * @tc.name: getModuleUsageRecord(maxNum) + * @tc.desc: When the number of starts of ability is less than maxNum, call interface getModuleUsageRecord + */ + it('bms_getModuleUsageRecordTest_0400', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0400=================='); + var bundleName = 'com.example.third1'; + var records = await bundle.getModuleUsageRecords(MAX_NUM); + checkModuleUsageRecord(records, 'bms_getModuleUsageRecordTest_0400'); + var result = checkIsExist(records, bundleName); + expect(result).assertEqual(true); + done(); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0500 + * @tc.name: getModuleUsageRecord(maxNum) by promise + * @tc.desc: Uninstall a third-party application, and then use the getModuleUsageRecord interface + * to query the activation times and last activation time of ability + */ + it('bms_getModuleUsageRecordTest_0500', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0500=================='); + var bundleName = 'com.example.third1' + await uninstall(bundleName); + console.debug('===================uninstall third1===================='); + var records = await bundle.getModuleUsageRecords(MAX_NUM) + checkModuleUsageRecord(records, 'bms_getModuleUsageRecordTest_0500'); + var result = checkIsExist(records, bundleName); + expect(result).assertEqual(false); + done(); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0600 + * @tc.name: getModuleUsageRecord(maxNum,callback: AsyncCallback>) + * @tc.desc: Uninstall a third-party application, and then use the getModuleUsageRecord interface + * to query the activation times and last activation time of ability + */ + it('bms_getModuleUsageRecordTest_0600', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0600=================='); + var bundleName = 'com.example.third1' + await bundle.getModuleUsageRecords(MAX_NUM, (err, data) => { + expect(err.code).assertEqual(0); + checkModuleUsageRecord(data, 'bms_getModuleUsageRecordTest_0600'); + var result = checkIsExist(data, bundleName); + expect(result).assertEqual(false); + done(); + }); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0700 + * @tc.name: getModuleUsageRecord(maxNum, callback: AsyncCallback>) + * @tc.desc: test getModuleUsageRecord with the invalid parameter + */ + it('bms_getModuleUsageRecordTest_0700', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0700=================='); + await bundle.getModuleUsageRecords(INVALID_NUM, (err, data) => { + console.debug('============err.code==========' + err.code); + expect(err.code).assertEqual(0); + expect(data.length).assertEqual(0); + done(); + }); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0800 + * @tc.name: getModuleUsageRecord(maxNum) by promise + * @tc.desc: test getModuleUsageRecord with the invalid parameter + */ + it('bms_getModuleUsageRecordTest_0800', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0800=================='); + var data = await bundle.getModuleUsageRecords(INVALID_NUM); + expect(data.length).assertEqual(0); + done(); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_0900 + * @tc.name: getModuleUsageRecord(maxNum, callback: AsyncCallback>) + * @tc.desc: test getModuleUsageRecord with the critical value + */ + it('bms_getModuleUsageRecordTest_0900', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_0900=================='); + await bundle.getModuleUsageRecords(0, (err, data) => { + console.debug('============err.code==========' + err.code); + expect(err.code).assertEqual(0); + expect(data.length).assertEqual(0); + done(); + }); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_1000 + * @tc.name: getModuleUsageRecord(maxNum, callback: AsyncCallback>) + * @tc.desc: test getModuleUsageRecord with the critical value + */ + it('bms_getModuleUsageRecordTest_1000', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_1000=================='); + var data = await bundle.getModuleUsageRecords(0); + expect(data.length).assertEqual(0); + done(); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_1100 + * @tc.name: getModuleUsageRecord(maxNum) by promise + * @tc.desc: Install a third-party which is uninstalled, and then use the getModuleUsageRecord interface + * to query the activation times and last activation time of ability + */ + it('bms_getModuleUsageRecordTest_1100', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_1100=================='); + var bundleName = 'com.example.third1' + var bundlePath = ['/data/test/bmsThirdBundleTest1.hap'] + await install(bundlePath); + console.debug('===================install third1===================='); + var records = await bundle.getModuleUsageRecords(MAX_NUM) + checkModuleUsageRecord(records, 'bms_getModuleUsageRecordTest_1100'); + var result = checkIsExist(records, bundleName); + expect(result).assertEqual(true); + done(); + }) + /* + * @tc.number: bms_getModuleUsageRecordTest_1200 + * @tc.name: getModuleUsageRecord(maxNum, callback: AsyncCallback>) + * @tc.desc: Install a third-party which is uninstalled, and then use the getModuleUsageRecord interface + * to query the activation times and last activation time of ability + */ + it('bms_getModuleUsageRecordTest_1200', 0, async function (done) { + console.debug('=====================bms_getModuleUsageRecordTest_1200=================='); + var bundleName = 'com.example.third1' + await bundle.getModuleUsageRecords(MAX_NUM, (err, data) => { + expect(err.code).assertEqual(0); + checkModuleUsageRecord(data, 'bms_getModuleUsageRecordTest_1200'); + var result = checkIsExist(data, bundleName); + expect(result).assertEqual(true); + done(); + }) + }) + + function checkModuleUsageRecord(data, caseName) { + console.debug('======================check ModuleUsageRecord begin=========================='); + console.debug(caseName + ' ==========record length is ========== ' + data.length); + expect(data.length).assertLarger(0); + for (let i = 0, length = data.length; i < length; i++) { + console.debug('=======All Info========' + JSON.stringify(data[i])); + console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName)); + expect(data[i].bundleName.length).assertLarger(0); + console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId)); + expect(data[i].appLabelId).assertLarger(0); + console.debug('=============name==============' + JSON.stringify(data[i].name)); + expect(data[i].name.length).assertLarger(0); + console.debug('=============labelId==============' + JSON.stringify(data[i].labelId)); + expect(data[i].labelId >= 0).assertTrue(); + console.debug('=============descriptionId==============' + JSON.stringify(data[i].descriptionId)); + expect(data[i].descriptionId).assertEqual(0); + console.debug('=============abilityName==============' + JSON.stringify(data[i].abilityName)); + expect(data[i].abilityName.length).assertLarger(0); + console.debug('=============abilityLabelId==============' + JSON.stringify(data[i].abilityLabelId)); + expect(data[i].abilityLabelId).assertLarger(0); + console.debug('===========abilityDescriptionId===========' + JSON.stringify(data[i].abilityDescriptionId)); + expect(data[i].abilityDescriptionId).assertLarger(0); + console.debug('=============abilityIconId==============' + JSON.stringify(data[i].abilityIconId)); + expect(data[i].abilityIconId).assertLarger(0); + console.debug('=============launchedCount==============' + JSON.stringify(data[i].launchedCount)); + expect(data[i].launchedCount).assertLarger(0); + console.debug('=============lastLaunchTime==============' + JSON.stringify(data[i].lastLaunchTime)); + expect(data[i].lastLaunchTime).assertLarger(0); + console.debug('=============isRemoved==============' + JSON.stringify(data[i].isRemoved)); + expect(data[i].isRemoved).assertEqual(false); + expect(data[i].installationFreeSupported).assertEqual(false); + } + } + function checkIsExist(data, bundleName) { + let bundles = new Map(); + for (let i = 0, length = data.length; i < length; i++) { + console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName)); + bundles.set(data[i].bundleName, data[i]); + } + if (bundles.has(bundleName)) { + console.debug(bundleName + ' is exist'); + return true; + } + else { + console.debug(bundleName + ' is not exist'); + return false; + } + } + async function install(bundlePath) { + var installer = await bundle.getBundleInstaller(); + await installer.install(bundlePath, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveinstallEvent); + + function onReceiveinstallEvent(err, data) { + console.debug('========install Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + } + async function uninstall(bundleName) { + var installer = await bundle.getBundleInstaller(); + await installer.uninstall(bundleName, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveinstallEvent); + + function onReceiveinstallEvent(err, data) { + console.debug('========uninstall Finish========'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + console.debug('========data.statusMessage========' + data.statusMessage); + } + } + afterAll(async (done) => { + console.debug('=======after all install========'); + let bundleName = 'com.example.third1' + uninstall(bundleName); + done(); + }) +}) \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/List.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..971b84dc373950bb4519f40114ef854f4d69fdec --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* +* 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. +*/ +require('./ActsBmsModuleUsageRecordTest.test.js') \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..cbc66afe2f7f70167e2a32714287fc2d3cd12d3c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsThirdBundleTest5") { + hap_profile = "./src/main/config.json" + hap_name = "bmsThirdBundleTest5" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..e981bb18f74abd867ba98e6f8c3b003d5a6d97a6 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/config.json @@ -0,0 +1,203 @@ +{ + "app": { + "bundleName": "com.example.third5", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.third5", + "name": ".BmsThirdBundle5", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.third5.AMainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "form": { + "formEntity": [ + "homeScreen", + "searchbox" + ], + "defaultHeight": 100, + "defaultWidth": 200, + "minHeight": 50, + "minWidth": 100 + }, + "forms": [ + { + "colorMode": "light", + "description": " JS5A Form", + "supportDimensions": [ + "1*2", + "2*2", + "2*4" + ], + "type": "JS", + "jsComponentName": "JS_name5A", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName5A", + "value": "com.huawei.weather.testWidget5A" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS5A", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard", + "metaData": { + "parameters": [ + { + "name": "Data5A", + "type": "float", + "description": "$string:mainability_description" + } + ], + "results": [ + { + "name": "Data5A", + "type": "float", + "description": "$string:mainability_description" + } + ], + "customizeData": [ + { + "name": "Data5A", + "value": "float", + "extra": "$string:mainability_description" + } + ] + } + }, + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".BMainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "forms": [ + { + "colorMode": "light", + "description": " JS5B Form", + "supportDimensions": [ + "1*2", + "4*4" + ], + "type": "JS", + "jsComponentName": "JS_name5B", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName5B", + "value": "com.huawei.weather.testWidget5B" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS5B", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard", + "metaData": { + "parameters": [ + { + "name": "Data5B", + "type": "float", + "description": "$string:mainability_description" + } + ], + "results": [ + { + "name": "Data5B", + "type": "float", + "description": "$string:mainability_description" + } + ], + "customizeData": [ + { + "name": "Data5B", + "value": "float", + "extra": "$string:mainability_description" + } + ] + } + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pagesB/index/index" + ], + "name": "default2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3b792f642b68b64dcda04be4fca26e954f645456 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = 'Third5 Ability A'; + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..39ed999620dd722a169e6637d8fae921ebc4e02a --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/default2/pagesB/index/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = 'Third5 Ability B'; + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7a01f8f72dea0f409a396a8c985421b7813b328b --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "app_name", + "value": "third5" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "bmainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..701cc401f50a69725691eaa71d496799695a9236 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsThirdBundleTest1") { + hap_profile = "./src/main/config.json" + hap_name = "bmsThirdBundleTest1" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..92ee7db348edcdce6dccca5978c9f27e9f7f33ea --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/config.json @@ -0,0 +1,135 @@ +{ + "app": { + "bundleName": "com.example.third1", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.third1.entry", + "name": "com.example.third1.BmsThirdBundle1", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.third1.MainAbility", + "icon": "$media:icon", + "form": { + "formEntity": [ + "homeScreen", + "searchbox" + ], + "defaultHeight": 100, + "defaultWidth": 200, + "minHeight": 50, + "minWidth": 100 + }, + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "forms": [ + { + "colorMode": "light", + "description": " JS1 Form", + "supportDimensions": [ + "1*2", + "2*2", + "2*4" + ], + "type": "JS", + "jsComponentName": "JS_name1", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName1", + "value": "com.huawei.weather.testWidget1" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS1", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard", + "visible": true, + "metaData": { + "parameters": [ + { + "name": "Data1", + "type": "float", + "description": "$string:mainability_description" + } + ], + "results": [ + { + "name": "Data1", + "type": "float", + "description": "$string:mainability_description" + } + ], + "customizeData": [ + { + "name": "Data1", + "value": "float", + "extra": "$string:mainability_description" + } + ] + } + } + ], + "shortcuts": [ + { + "icon": "$media:icon", + "shortcutId": "id.third1", + "label": "$string:app_name", + "intents": [ + { + "targetClass": "com.example.third1.MainAbility", + "targetBundle": "com.example.third1" + } + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c6026ced03c6de33ed340902a3a6da47939e1585 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import commonEvent from '@ohos.commonevent' +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_Third1_Publish_CommonEvent====>"); +} +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + commonEvent.publish("ACTS_Third1_Publish_CommonEvent", PublishCallBackOne); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c3a0c7230d4f00d5efc49b89b7f34e6a6974bad9 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "third1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..07273b2070c3f2bccd2f425e6645d16b079de8a3 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsThirdBundleTestA1") { + hap_profile = "./src/main/config.json" + hap_name = "bmsThirdBundleTestA1" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..1a1c2190b8cbc2947fe262777750a6f3090adf01 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/config.json @@ -0,0 +1,134 @@ +{ + "app": { + "bundleName": "com.example.third1", + "vendor": "example", + "version": { + "code": 2, + "name": "2.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.third1.entry", + "name": "com.example.third1.BmsThirdBundle1", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.third1.AMainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "form": { + "formEntity": [ + "homeScreen", + "searchbox" + ], + "defaultHeight": 100, + "defaultWidth": 200, + "minHeight": 50, + "minWidth": 100 + }, + "forms": [ + { + "colorMode": "light", + "description": " JSA1 Form", + "supportDimensions": [ + "2*2", + "2*4" + ], + "type": "JS", + "jsComponentName": "JS_nameA1", + "metaData": { + "customizeData": [ + { + "name": "originWidgetNameA1", + "value": "com.huawei.weather.testWidgetA1" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JSA1", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard", + "visible": true, + "metaData": { + "parameters": [ + { + "name": "DataA1", + "type": "float", + "description": "$string:mainability_description" + } + ], + "results": [ + { + "name": "DataA1", + "type": "float", + "description": "$string:mainability_description" + } + ], + "customizeData": [ + { + "name": "DataA1", + "value": "float", + "extra": "$string:mainability_description" + } + ] + } + } + ], + "shortcuts": [ + { + "icon": "$media:icon", + "shortcutId": "id.thirdA1", + "label": "$string:shortcut", + "intents": [ + { + "targetClass": "com.example.third1.AMainAbility", + "targetBundle": "com.example.third1" + } + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..68ee5f38373225b48f272bcc2e5d2e9fac2fcc18 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "app_name", + "value": "thirdA1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "shortcut", + "value": "JS_Phone_Empty Shortcut" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..229f96ae35a72cf1fcccb6780a9f74c49c58e1b1 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsThirdBundleTest4") { + hap_profile = "./src/main/config.json" + hap_name = "bmsThirdBundleTest4" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..44caf031db392ab79b7329dbc708d887b0804880 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/config.json @@ -0,0 +1,139 @@ +{ + "app": { + "bundleName": "com.example.third4", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.third4", + "name": ".BmsThirdBundle4", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.third4.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "form": { + "formEntity": [ + "homeScreen", + "searchbox"], + "defaultHeight": 100, + "defaultWidth": 200, + "minHeight": 50, + "minWidth": 100 + }, + "forms": [ + { + "colorMode": "light", + "description": " JS4A Form", + "supportDimensions": [ "2*4", "4*4" ], + "type": "JS", + "jsComponentName": "JS_name4A", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName4A", + "value": "com.huawei.weather.testWidget4A" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS4A", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + }, + { + "colorMode": "light", + "description": " JS4B Form", + "supportDimensions": [ "1*2", "2*2" , "2*4"], + "type": "JS", + "jsComponentName": "JS_name4B", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName4B", + "value": "com.huawei.weather.testWidget4B" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS4B", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard" + } + ], + "shortcuts": [ + { + "icon": "$media:icon", + "shortcutId": "id.third4A", + "label": "$string:app_name", + "intents": [ + { + "targetClass":"com.example.third4A.MainAbility", + "targetBundle":"com.example.third4A" + } + ] + }, + { + "icon": "$media:icon", + "shortcutId": "id.third4B", + "label": "$string:app_name", + "intents": [ + { + "targetClass": "com.example.third4B.MainAbility", + "targetBundle": "com.example.third4B" + } + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..6046f4d0f0d574d64084caa58fcf9a51c8b01d26 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "third4" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e56b50a07ef5fc627dfc8bd9fedb0b1a36cb8f16 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsThirdBundleJs") { + hap_profile = "./src/main/config.json" + hap_name = "bmsThirdBundleJs" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..10cfb165b6495c7e0356fef31a609d94c8fb0b7f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.js", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.js", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "srcLanguage": "js", + "visible": true, + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..41f425000199f5ca867b893a36deda040f221f4b --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ThirdJsTest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosjsscene/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..4237a64e450658cd04225c8b7dcddfe86133e919 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsSystemBundleTest1") { + hap_profile = "./src/main/config.json" + hap_name = "bmsSystemBundleTest1" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..06a9c89753947cd7707f91187f3ae0430c08ff86 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/config.json @@ -0,0 +1,114 @@ +{ + "app": { + "bundleName": "com.example.system1", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.system1", + "name": ".BmsSystemBundle1", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.system1.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "forms": [ + { + "colorMode": "light", + "description": " JS1S Form", + "supportDimensions": [ "1*2", "2*2", "2*4", "4*4"], + "type": "JS", + "jsComponentName": "JS_name1S", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName1S", + "value": "com.huawei.weather.testWidget1S" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS1S", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard", + "metaData": { + "parameters": [{ + "name": "Data1S", + "type": "float", + "description": "$string:mainability_description" + }], + "results": [{ + "name": "Data1S", + "type": "float", + "description": "$string:mainability_description" + }], + "customizeData": [{ + "name": "Data1S", + "value": "float", + "extra": "$string:mainability_description" + }] + } + } + ], + "shortcuts": [ + { + "icon": "$media:icon", + "shortcutId": "id.system1", + "label": "$string:shortcut", + "intents": [ + { + "targetClass":"com.example.system1.MainAbility", + "targetBundle":"com.example.system1" + } + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ba4d8c6bd93d2c5cd492ab0f8eb4382763eb0e5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "app_name", + "value": "system1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "shortcut", + "value": "JS_Phone_Empty Shortcut" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..94ae80c2306aba7dc1b52045be9ae31a77ccd7f7 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsVendorBundleTest1") { + hap_profile = "./src/main/config.json" + hap_name = "bmsVendorBundleTest1" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..c00f7a3ae1ddfc072b68c3c81e3388f941887d3c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/config.json @@ -0,0 +1,136 @@ +{ + "app": { + "bundleName": "com.example.vendor1", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.vendor1", + "name": ".BmsVendorBundle1", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.vendor.home" + ], + "actions": [ + "action.vendor.home" + ] + } + ], + "name": "com.example.vendor1.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "forms": [ + { + "colorMode": "light", + "description": " JS1V Form", + "supportDimensions": [ "1*2", "2*2", "2*4", "4*4"], + "type": "JS", + "jsComponentName": "JS_name1V", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName1V", + "value": "com.huawei.weather.testWidget1V" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS1V", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + }, + { + "colorMode": "light", + "description": " JS1V2 Form", + "supportDimensions": [ "1*2", "2*4", "4*4"], + "type": "JS", + "jsComponentName": "JS_name1V2", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName1V2", + "value": "com.huawei.weather.testWidget1V2" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS1V2", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard", + "metaData": { + "parameters": [{ + "name": "Data1V", + "type": "float", + "description": "$string:mainability_description" + }], + "results": [{ + "name": "Data1V", + "type": "float", + "description": "$string:mainability_description" + }], + "customizeData": [{ + "name": "Data1V", + "value": "float", + "extra": "$string:mainability_description" + }] + } + } + ], + "shortcuts": [ + { + "icon": "$media:icon", + "shortcutId": "id.vendor1", + "label": "$string:shortcut", + "intents": [ + { + "targetClass":"com.example.vendor1.MainAbility", + "targetBundle":"com.example.vendor1" + } + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ce97c66cdac987eedf5f7de0d3f0546d38e634cd --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "app_name", + "value": "vendor1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "shortcut", + "value": "JS_Phone_Empty Shortcut" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..8e0f90279090c79b83756c2069854583a920d4b5 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsThirdBundleTest2") { + hap_profile = "./src/main/config.json" + hap_name = "bmsThirdBundleTest2" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..2cb8e72bd85605c64f890f5520750748007ceb53 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.third2", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.third2", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.third2.MainAbility", + "srcLanguage": "js", + "visible": true, + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..66a83f6217358f0f9a5ad6d2078868befdc8a19f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 50px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f62a9c1add002a9aaa1409eae2b9ebb6439e1342 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,27 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9ec7fadd567165c5840fa3e6c9cb5253007fd3ce --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "third2" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfossecondscene/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..0603b98d38297f5a5ca7d384d8065876f96f17cc --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsThirdBundleTest3") { + hap_profile = "./src/main/config.json" + hap_name = "bmsThirdBundleTest3" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..96b253543ee7c5ebdba24cf098157e430a9cde1d --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/config.json @@ -0,0 +1,135 @@ +{ + "app": { + "bundleName": "com.example.third1", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.third3", + "name": ".BmsThirdBundle3", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "bmsThirdBundle3", + "moduleType": "feature" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.third3.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "form": { + "formEntity": [ + "homeScreen", + "searchbox" + ], + "defaultHeight": 100, + "defaultWidth": 200, + "minHeight": 50, + "minWidth": 100 + }, + "forms": [ + { + "colorMode": "light", + "description": " JS3 Form", + "supportDimensions": [ + "2*2", + "2*4", + "4*4" + ], + "type": "JS", + "jsComponentName": "JS_name3", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName3", + "value": "com.huawei.weather.testWidget3" + } + ] + }, + "isDefault": true, + "deepLink": "ability://com.example.myapplication.fa/.MainAbility", + "defaultDimension": "1*2", + "name": "Form_JS3", + "scheduledUpateTime": "21:55", + "updateEnabled": true, + "updateDuration": 1 + } + ], + "launchType": "standard", + "metaData": { + "parameters": [ + { + "name": "Data3", + "type": "float", + "description": "$string:mainability_description" + } + ], + "results": [ + { + "name": "Data3", + "type": "float", + "description": "$string:mainability_description" + } + ], + "customizeData": [ + { + "name": "Data3", + "value": "float", + "extra": "$string:mainability_description" + } + ] + } + } + ], + "shortcuts": [ + { + "icon": "$media:icon", + "shortcutId": "id.third3", + "label": "$string:app_name", + "intents": [ + { + "targetClass": "com.example.third3.MainAbility", + "targetBundle": "com.example.third3" + } + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ad1fae0a88670fa0d072f01a4f2988c020e0f4b4 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,29 @@ +/* + * 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. + */ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "third3" + }, + onInit() { + this.title = this.data.title; + }, + onShow() { + }, + onReady() { + }, +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..cdb16ba191f153caa2a3637e3ed0a3e30971cc4b --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "third3" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c90c57a10a2cff93c5dfe1b2812f668955948a88 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsMainAbilityFirstScene") { + hap_profile = "./src/main/config.json" + hap_name = "bmsMainAbilityFirstScene" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..93e6b5b66d76669727da0e025e449c9ea8cfdabb --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.bmsmainabilityfirstscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.bmsmainabilityfirstscene", + "mainAbility": "com.example.bmsmainabilityfirstscene.MainAbility", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.bmsmainabilityfirstscene.MainAbility", + "visible": true, + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..f4beb9efb5638d301bb3fbceed2db5342f83e276 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the 'License'); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an 'AS IS' BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0451b790e61f530986a45af5858782eb4fac86b5 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* +* 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. +*/ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8e53a1056715168ef85218ad780262a5905d96a7 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MainAbilityFirstScene" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilityfirstscene/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5544ddd262b61af0ee3432908f6da58879af95fe --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_hap("bmsMainAbilitySecondScene") { + hap_profile = "./src/main/config.json" + hap_name = "bmsMainAbilitySecondScene" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/js/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/package.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..31511fa2addabfeebc2d64c74e0f774f3fe9b89c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/config.json @@ -0,0 +1,53 @@ +{ + "app": { + "bundleName": "com.example.bmsmainabilityfirstscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.bmsmainabilitysecondscene", + "mainAbility": "com.example.bmsmainabilitysecondscene.MainAbility", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "bmsmainabilitysecondscene", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.bmsmainabilitysecondscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..f4beb9efb5638d301bb3fbceed2db5342f83e276 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the 'License'); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an 'AS IS' BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0451b790e61f530986a45af5858782eb4fac86b5 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/default/pages/index/index.js @@ -0,0 +1,25 @@ +/* +* 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. +*/ +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..206b23b52f9186579400174bc72ae740681b0422 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "bmsMainAbilitySecondScene" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsmainabilitysecondscene/src/main/js/resources/base/media/icon.png differ