diff --git a/appexecfwk/bundle_standard/bundlemanager/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/BUILD.gn index ad9f0ea1b7b53015781ebeb5606b6ea32d5671f5..222e7f502ed29851fa7822ec26f6448843a77999 100644 --- a/appexecfwk/bundle_standard/bundlemanager/BUILD.gn +++ b/appexecfwk/bundle_standard/bundlemanager/BUILD.gn @@ -17,6 +17,7 @@ group("bundlemanager") { testonly = true if (is_standard_system) { deps = [ + "actsbmsaccesstokentest:ActsBmsAccessTokenTest", "actsbmsallshortcutinfotest:ActsBmsAllShortcutInfoTest", "actsbmscheckpermissiontest:ActsBmsCheckPermissionTest", "actsbmsgetinfostest:ActsBmsGetInfosTest", @@ -28,6 +29,9 @@ group("bundlemanager") { "actsbundlemanagertest:ActsBundleManagerTest", "actsbundlemanageruninstall:ActsBundleManagerUninstallTest", "actsbundlemgrmultipleinstalltest:ActsBundleMgrMultipleInstallTest", + "sceneProject/bmsaccesstokenone:bmsAccessTokenTest1", + "sceneProject/bmsaccesstokenthree:bmsAccessTokenTest3", + "sceneProject/bmsaccesstokentwo:bmsAccessTokenTest2", "sceneProject/bmseighthright:eighth_right", "sceneProject/bmseleventhright:eleventh_right", "sceneProject/bmsfifthright:fifth_right", diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..baef76b51c587eacb7ca2c8c8fb68882aabe7c6e --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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("ActsBmsAccessTokenTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBmsAccessTokenTest" +} +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/actsbmsaccesstokentest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..29a7021a723d5fb5b81168d02cebf82ae2ddef5a --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/Test.json @@ -0,0 +1,39 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "120000", + "package": "com.example.actsbmsaccesstokentest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsBmsAccessTokenTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount", + "mkdir /data/test" + ] + }, + { + "type": "PushKit", + "push": [ + "bmsAccessTokenTest1.hap->/data/test/bmsAccessTokenTest1.hap", + "bmsAccessTokenTest2.hap->/data/test/bmsAccessTokenTest2.hap", + "bmsAccessTokenTest3.hap->/data/test/bmsAccessTokenTest3.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/test/*.hap" + ] + } + ] +} diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..e64d6faec440487d1e369fd5ba529aefeeaea608 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.actsbmsaccesstokentest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsbmsaccesstokentest", + "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.actsbmsaccesstokentest.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/actsbmsaccesstokentest/entry/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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/actsbmsaccesstokentest/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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/actsbmsaccesstokentest/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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/actsbmsaccesstokentest/entry/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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/actsbmsaccesstokentest/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..13ae33e07e3a90032d5fb5589183072449422c77 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3b3dd6a8965e7ef83b69fa685de7624e3d377497 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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 AccessToken' + }, + onInit() { + this.title = 'Test AccessToken'; + }, + 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/actsbmsaccesstokentest/entry/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9098ff6185ad2b33ac3fe714e7009f9273b38c95 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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/actsbmsaccesstokentest/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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/actsbmsaccesstokentest/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js new file mode 100644 index 0000000000000000000000000000000000000000..4a92ff79469c650a835298a14f2ddb223efe2d9e --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js @@ -0,0 +1,228 @@ +/* + * 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, it, expect } from 'deccjsunit/index' + +const NAMECOUNT = 10000; + +describe('ActsBmsAccessTokenTest', function () { + + /* + * @tc.number: bms_AccessTokenId_0100 + * @tc.name: test accessTokenId + * @tc.desc: get the accessTokenId + */ + it('bms_AccessTokenId_0100', 0, async function (done) { + console.info('bms_AccessTokenId_0100 start'); + var bundlePath = ['/data/test/bmsAccessTokenTest1.hap']; + var bundleName = 'com.example.bmsaccesstoken1'; + let installer = await bundle.getBundleInstaller(); + installer.install(bundlePath, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveInstallEvent); + + async function OnReceiveInstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + bundle.getApplicationInfo(bundleName, 0, 0).then(applicationInfo => { + console.info('accessTokenId: '+ applicationInfo.accessTokenId); + expect(applicationInfo.name).assertEqual(bundleName); + expect(applicationInfo.accessTokenId).assertLarger(0); + }) + installer.uninstall(bundleName, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveUninstallEvent); + }; + function OnReceiveUninstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + done(); + }; + }); + + /* + * @tc.number: bms_AccessTokenId_0200 + * @tc.name: test reqPermissionStates + * @tc.desc: get the reqPermissions and reqPermissionStates + */ + it('bms_AccessTokenId_0200', 0, async function (done) { + console.info('bms_AccessTokenId_0200 start'); + var bundlePath = ['/data/test/bmsAccessTokenTest1.hap']; + var bundleName = 'com.example.bmsaccesstoken1'; + let installer = await bundle.getBundleInstaller(); + installer.install(bundlePath, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveInstallEvent); + + async function OnReceiveInstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + bundle.getBundleInfo(bundleName, 16).then(bundleInfo => { + expect(bundleInfo.name).assertEqual(bundleName); + expect(bundleInfo.reqPermissions.length).assertEqual(3); + expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); + expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA"); + expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); + expect(bundleInfo.reqPermissionStates.length).assertEqual(3); + expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[1]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[2]).assertEqual(0); + }) + installer.uninstall(bundleName, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveUninstallEvent); + }; + function OnReceiveUninstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + done(); + }; + }); + + /* + * @tc.number: bms_AccessTokenId_0300 + * @tc.name: test reqPermissionStates + * @tc.desc: get the reqPermissions and reqPermissionStates + */ + it('bms_AccessTokenId_0300', 0, async function (done) { + console.info('bms_AccessTokenId_0300 start'); + var bundlePath1 = ['/data/test/bmsAccessTokenTest1.hap']; + var bundlePath2 = ['/data/test/bmsAccessTokenTest2.hap']; + var bundleName = 'com.example.bmsaccesstoken1'; + let installer = await bundle.getBundleInstaller(); + installer.install(bundlePath1, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveInstallEvent); + + async function OnReceiveInstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + installer.install(bundlePath2, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveUpdateEvent); + }; + async function OnReceiveUpdateEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + bundle.getBundleInfo(bundleName, 16).then(bundleInfo => { + expect(bundleInfo.name).assertEqual(bundleName); + expect(bundleInfo.reqPermissions.length).assertEqual(5); + expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); + expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); + expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND"); + expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.SYSTEM_FLOAT_WINDOW"); + expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.USE_BLUETOOTH"); + expect(bundleInfo.reqPermissionStates.length).assertEqual(5); + expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[1]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[2]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[3]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[4]).assertEqual(0); + }) + installer.uninstall(bundleName, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveUninstallEvent); + } + function OnReceiveUninstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + done(); + }; + }); + + /* + * @tc.number: bms_AccessTokenId_0400 + * @tc.name: test reqPermissionStates + * @tc.desc: get the reqPermissions and reqPermissionStates + */ + it('bms_AccessTokenId_0400', 0, async function (done) { + console.info('bms_AccessTokenId_0400 start'); + var bundlePath1 = ['/data/test/bmsAccessTokenTest1.hap']; + var bundlePath2 = ['/data/test/bmsAccessTokenTest3.hap']; + var bundleName = 'com.example.bmsaccesstoken1'; + let installer = await bundle.getBundleInstaller(); + installer.install(bundlePath1, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveInstallEvent); + + async function OnReceiveInstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + installer.install(bundlePath2, { + userId: 100, + installFlag: 0, + isKeepData: false + }, OnReceiveUpdateEvent); + }; + async function OnReceiveUpdateEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + bundle.getBundleInfo(bundleName, 16).then(bundleInfo => { + expect(bundleInfo.name).assertEqual(bundleName); + expect(bundleInfo.reqPermissions.length).assertEqual(6); + expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); + expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA"); + expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); + expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND"); + expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.SYSTEM_FLOAT_WINDOW"); + expect(bundleInfo.reqPermissions[5]).assertEqual("ohos.permission.USE_BLUETOOTH"); + expect(bundleInfo.reqPermissionStates.length).assertEqual(6); + expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[1]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[2]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[3]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[4]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[5]).assertEqual(0); + }) + installer.uninstall(bundleName, { + userId: 100, + installFlag: 1, + isKeepData: false + }, OnReceiveUninstallEvent); + } + function OnReceiveUninstallEvent(err, data) { + expect(err.code).assertEqual(0); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual("SUCCESS"); + done(); + }; + }); +}) diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/List.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..7fab13e6f52e650b4fc9f330cee2535f2e2c2cbc --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/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('./ActsBmsAccessTokenTest.test.js') \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..323f8fb39278bd00bcb1aed007275ce4bd577d36 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/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("bmsAccessTokenTest1") { + hap_profile = "./src/main/config.json" + hap_name = "bmsAccessTokenTest1" + 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/bmsaccesstokenone/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..ff97f0714b51858273cf417ee8a7c56eafce07ff --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/config.json @@ -0,0 +1,104 @@ +{ + "app": { + "bundleName": "com.example.bmsaccesstoken1", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.bmsaccesstoken1", + "name": ".MyApplication1", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "standard", + "language": "C++", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName", + "value": "com.weather.testWidget" + } + ] + } + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "definePermissions":[ + { + "availableLevel":"normal", + "description":"ALPHA description", + "distributedSceneEnable":true, + "grantMode":"user_grant", + "label":"ALPHA label", + "name":"ohos.permission.ALPHA", + "provisionEnable":true + }, + { + "availableLevel":"normal", + "description":"BETA description", + "distributedSceneEnable":true, + "grantMode":"user_grant", + "label":"BETA label", + "name":"ohos.permission.BETA", + "provisionEnable":true + } + ], + "reqPermissions":[ + { + "name":"ohos.permission.ALPHA", + "reason":"use ohos.permission.ALPHA" + }, + { + "name":"ohos.permission.BETA", + "reason":"use ohos.permission.BETA" + }, + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", + "reason": "use ohos.permission.KEEP_BACKGROUND_RUNNING" + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/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/bmsaccesstokenone/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/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/bmsaccesstokenone/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/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/bmsaccesstokenone/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/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/bmsaccesstokenone/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/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/bmsaccesstokenone/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0c5796d114f2e6518207e036911188aa42dece17 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "bmsfirstright" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenone/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/bmsaccesstokenone/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..b2cee82cd1c7c8688f1058e6111f94c9929d6eb2 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/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("bmsAccessTokenTest3") { + hap_profile = "./src/main/config.json" + hap_name = "bmsAccessTokenTest3" + 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/bmsaccesstokenthree/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..b03b92b9bc4288e4740787e1cbfef8d19b76285d --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/config.json @@ -0,0 +1,112 @@ +{ + "app": { + "bundleName": "com.example.bmsaccesstoken1", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.bmsaccesstoken2", + "name": ".MyApplication2", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "feature", + "moduleType": "feature" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "standard", + "language": "C++", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName", + "value": "com.weather.testWidget" + } + ] + } + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "definePermissions":[ + { + "availableLevel":"normal", + "description":"ALPHA description", + "distributedSceneEnable":true, + "grantMode":"user_grant", + "label":"ALPHA label", + "name":"ohos.permission.ALPHA", + "provisionEnable":true + }, + { + "availableLevel":"normal", + "description":"BETA description", + "distributedSceneEnable":true, + "grantMode":"user_grant", + "label":"BETA label", + "name":"ohos.permission.BETA", + "provisionEnable":true + } + ], + "reqPermissions":[ + { + "name":"ohos.permission.ALPHA", + "reason":"use ohos.permission.ALPHA" + }, + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", + "reason": "use ohos.permission.KEEP_BACKGROUND_RUNNING" + }, + { + "name": "ohos.permission.LOCATION_IN_BACKGROUND", + "reason": "use ohos.permission.LOCATION_IN_BACKGROUND" + }, + { + "name": "ohos.permission.USE_BLUETOOTH", + "reason": "use ohos.permission.USE_BLUETOOTH" + }, + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "reason": "use ohos.permission.SYSTEM_FLOAT_WINDOW" + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/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/bmsaccesstokenthree/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/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/bmsaccesstokenthree/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/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/bmsaccesstokenthree/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/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/bmsaccesstokenthree/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/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/bmsaccesstokenthree/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0c5796d114f2e6518207e036911188aa42dece17 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "bmsfirstright" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokenthree/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/bmsaccesstokenthree/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/BUILD.gn b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5ee3769f4a3d70e1aeafa7deee4001dd9ebd2a92 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/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("bmsAccessTokenTest2") { + hap_profile = "./src/main/config.json" + hap_name = "bmsAccessTokenTest2" + 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/bmsaccesstokentwo/Test.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..7a88763ed8d2ac31dd30211b9574f47273e84549 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/signature/openharmony_sx.p7b b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..3ccb165a2eae63c6c3156cb08a261e1b194b3991 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/config.json @@ -0,0 +1,112 @@ +{ + "app": { + "bundleName": "com.example.bmsaccesstoken1", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.bmsaccesstoken1", + "name": ".MyApplication1", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "standard", + "language": "C++", + "metaData": { + "customizeData": [ + { + "name": "originWidgetName", + "value": "com.weather.testWidget" + } + ] + } + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "definePermissions":[ + { + "availableLevel":"normal", + "description":"ALPHA description", + "distributedSceneEnable":true, + "grantMode":"user_grant", + "label":"ALPHA label", + "name":"ohos.permission.ALPHA", + "provisionEnable":true + }, + { + "availableLevel":"normal", + "description":"BETA description", + "distributedSceneEnable":true, + "grantMode":"user_grant", + "label":"BETA label", + "name":"ohos.permission.BETA", + "provisionEnable":true + } + ], + "reqPermissions":[ + { + "name":"ohos.permission.ALPHA", + "reason":"use ohos.permission.ALPHA" + }, + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", + "reason": "use ohos.permission.KEEP_BACKGROUND_RUNNING" + }, + { + "name": "ohos.permission.LOCATION_IN_BACKGROUND", + "reason": "use ohos.permission.LOCATION_IN_BACKGROUND" + }, + { + "name": "ohos.permission.USE_BLUETOOTH", + "reason": "use ohos.permission.USE_BLUETOOTH" + }, + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "reason": "use ohos.permission.SYSTEM_FLOAT_WINDOW" + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/app.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/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/bmsaccesstokentwo/src/main/js/default/i18n/en-US.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/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/bmsaccesstokentwo/src/main/js/default/i18n/zh-CN.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/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/bmsaccesstokentwo/src/main/js/default/pages/index/index.css b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/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/bmsaccesstokentwo/src/main/js/default/pages/index/index.hml b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..23ac44c8d392bb6b777ebae8c8a6f17bfff13f83 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/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/bmsaccesstokentwo/src/main/js/resources/base/element/string.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0c5796d114f2e6518207e036911188aa42dece17 --- /dev/null +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "bmsfirstright" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/src/main/js/resources/base/media/icon.png b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsaccesstokentwo/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/bmsaccesstokentwo/src/main/js/resources/base/media/icon.png differ