diff --git a/aafwk/aafwk_standard/BUILD.gn b/aafwk/aafwk_standard/BUILD.gn index 88c173e8cbb329b5bdd5f18f826ba41e84924e04..18fba1ae39ca34cdd42c1a02e4cb9cdde2165a54 100755 --- a/aafwk/aafwk_standard/BUILD.gn +++ b/aafwk/aafwk_standard/BUILD.gn @@ -31,6 +31,7 @@ group("aafwk_standard") { "amsdisplayIdtest:amsdisplayIdtest", "amsgetabilityprocessinfo:amsgetabilityprocessinfo", "context:context", + "fa:fa", "featureability:featureability", "formmanager:formmanager", "killprocesswithaccountstage:killprocesswithaccountstage", diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js b/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js index 086d084961002d3abdd2a35e246a62006253914c..a3edd3e47aaa3fad9b934009ab8bb5f2096bc349 100644 --- a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js +++ b/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js @@ -24,7 +24,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_GetIdSync_0100', 0, function (done) { console.log('dataUriUtils getIdSync start1'); - var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/1221"); + var result = dataUriUtils.getId("com.ix.dataUriUtils/1221"); console.log('dataUriUtils getIdSync URI : ' + result); expect(typeof(result)).assertEqual("number"); @@ -40,7 +40,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_GetIdSync_0200', 0, function (done) { console.log('dataUriUtils getIdSync start2 '); - var result = dataUriUtils.getIdSync("com.ix.dataUriUtils1221"); + var result = dataUriUtils.getId("com.ix.dataUriUtils1221"); console.log('dataUriUtils getIdSync URI : ' + result); expect(typeof(result)).assertEqual("number"); @@ -57,7 +57,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_GetIdSync_0300', 0, function (done) { console.log('dataUriUtils getIdSync start3 '); - var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/11234567890"); + var result = dataUriUtils.getId("com.ix.dataUriUtils/11234567890"); console.log('dataUriUtils getIdSync URI : ' + result); expect(typeof(result)).assertEqual("number"); @@ -74,7 +74,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_GetIdSync_0400', 0, function (done) { console.log('dataUriUtils getIdSync start4 '); - var result = dataUriUtils.getIdSync("com.ix.dataUriUtils"); + var result = dataUriUtils.getId("com.ix.dataUriUtils"); console.log('dataUriUtils getIdSync URI : ' + result); expect(typeof(result)).assertEqual("number"); @@ -91,7 +91,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_GetIdSync_0500', 0, function (done) { console.log('dataUriUtils getIdSync start5 '); - var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/-777"); + var result = dataUriUtils.getId("com.ix.dataUriUtils/-777"); console.log('dataUriUtils getIdSync URI : ' + result);//-777 expect(typeof(result)).assertEqual("number"); @@ -109,7 +109,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_AttachIdSync_0100',0, function (done) { console.log('dataUriUtils attachIdSync start1 '); var idint = 1122; - var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint); + var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint); console.log('dataUriUtils attachIdSync URI :' + result) expect(typeof(result)).assertEqual("string"); @@ -127,7 +127,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_AttachIdSync_0200',0, function (done) { console.log('dataUriUtils attachIdSync start2 '); var idint = 0; - var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils/777",idint); + var result = dataUriUtils.attachId("com.ix.dataUriUtils/777",idint); console.log('dataUriUtils attachIdSync URI :' + result) expect(typeof(result)).assertEqual("string"); @@ -145,7 +145,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_AttachIdSync_0300',0, function (done) { console.log('dataUriUtils attachIdSync start3 '); var idint = 456789; - var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils/123",idint); + var result = dataUriUtils.attachId("com.ix.dataUriUtils/123",idint); console.log('dataUriUtils attachIdSync URI :' + result) expect(typeof(result)).assertEqual("string"); @@ -163,7 +163,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_AttachIdSync_0400',0, function (done) { console.log('dataUriUtils attachIdSync start4 '); var idint = 123456789011; - var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint); + var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint); console.log('dataUriUtils attachIdSync URI :' + result) expect(typeof(result)).assertEqual("string"); @@ -181,7 +181,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_AttachIdSync_0500',0, function (done) { console.log('dataUriUtils attachIdSync start5 '); var idint = -1; - var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint); + var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint); console.log('dataUriUtils attachIdSync URI :' + result) expect(typeof(result)).assertEqual("string"); @@ -198,7 +198,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_DeleteIdSync_0100',0, function (done) { console.log('dataUriUtils deleteIdSync start1 '); - var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils"); + var result = dataUriUtils.deleteId("com.ix.dataUriUtils"); console.log('dataUriUtils deleteIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -215,7 +215,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_DeleteIdSync_0200',0, function (done) { console.log('dataUriUtils deleteIdSync start2 '); - var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/1122"); + var result = dataUriUtils.deleteId("com.ix.dataUriUtils/1122"); console.log('dataUriUtils deleteIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -232,7 +232,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_DeleteIdSync_0300',0, function (done) { console.log('dataUriUtils deleteIdSync start3 '); - var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils1122"); + var result = dataUriUtils.deleteId("com.ix.dataUriUtils1122"); console.log('dataUriUtils deleteIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -249,7 +249,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_DeleteIdSync_0400',0, function (done) { console.log('dataUriUtils deleteIdSync start4 '); - var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/-1"); + var result = dataUriUtils.deleteId("com.ix.dataUriUtils/-1"); console.log('dataUriUtils deleteIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -266,7 +266,7 @@ describe('ActsDataUriUtilsTest', function () { */ it('ACTS_DeleteIdSync_0500',0, function (done) { console.log('dataUriUtils deleteIdSync start5 '); - var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/1122/2211"); + var result = dataUriUtils.deleteId("com.ix.dataUriUtils/1122/2211"); console.log('dataUriUtils deleteIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -284,7 +284,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_UpdateIdSync_0100',0, function (done) { console.log('dataUriUtils updateIdSync start1 '); var idint = 1122; - var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils",idint); + var result = dataUriUtils.updateId("com.ix.dataUriUtils",idint); console.log('updateIdSync updateIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -302,7 +302,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_UpdateIdSync_0200',0, function (done) { console.log('dataUriUtils updateIdSync start2 '); var idint = 1122; - var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/",idint) + var result = dataUriUtils.updateId("com.ix.dataUriUtils/",idint) console.log('updateIdSync updateIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -320,7 +320,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_UpdateIdSync_0300',0, function (done) { console.log('dataUriUtils updateIdSync start3 '); var idint = 3344; - var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/-1",idint) + var result = dataUriUtils.updateId("com.ix.dataUriUtils/-1",idint) console.log('updateIdSync updateIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -338,7 +338,7 @@ describe('ActsDataUriUtilsTest', function () { it('ACTS_UpdateIdSync_0400',0, function (done) { console.log('dataUriUtils updateIdSync start4 '); var idint = 5566; - var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/123456789011",idint) + var result = dataUriUtils.updateId("com.ix.dataUriUtils/123456789011",idint) console.log('updateIdSync updateIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); @@ -360,7 +360,7 @@ describe('ActsDataUriUtilsTest', function () { expect(typeof(idint)).assertEqual("number"); console.log('dataUriUtils updateIdSync start666 '); - var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/1122",idint) + var result = dataUriUtils.updateId("com.ix.dataUriUtils/1122",idint) console.log('updateIdSync updateIdSync URI : ' + result); expect(typeof(result)).assertEqual("string"); expect(result).assertEqual("com.ix.dataUriUtils/0"); diff --git a/aafwk/aafwk_standard/fa/BUILD.gn b/aafwk/aafwk_standard/fa/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f75ceef5a8bad76dae0eb4baf6e2884c612ae364 --- /dev/null +++ b/aafwk/aafwk_standard/fa/BUILD.gn @@ -0,0 +1,26 @@ +# 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") + +group("fa") { + testonly = true + if (is_standard_system) { + deps = [ + "faapplicationinfo:ActsApplicationinfoTest", + "faconfigurationconstant:ActsConfigurationconstantTest", + "facoverapi:ActsCoverapiTest", + "faequeryabilitybywant:ActsEqueryabilitybywantTest", + ] + } +} diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/BUILD.gn b/aafwk/aafwk_standard/fa/faapplicationinfo/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..4d0ad9b2a0737a0ab3dec91d1a607d18087f233c --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/BUILD.gn @@ -0,0 +1,33 @@ +# 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("ActsApplicationinfoTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsApplicationinfoTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js" + hap_profile = "entry/src/main/config.json" + js2abc = true +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/Test.json b/aafwk/aafwk_standard/fa/faapplicationinfo/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..e8b27f81e8e298e06f01977687ad637cb4fcac13 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.applicationinfo", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsApplicationinfoTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/config.json b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..b87889ffb7143de2f11027a4add280933b9d7b56 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/config.json @@ -0,0 +1,88 @@ +{ + "app": { + "bundleName": "com.example.applicationinfo", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.applicationinfo", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility2", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/app.js b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..58d12b7b501fbf46db906a86187aaf18dfb1f677 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/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("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "page": "Second Page", + "next": "Next Page", + "back": "Back" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "page": "第二页", + "next": "下一页", + "back": "返回" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..8b5cce53e8f61458e5a3005866217e0df1dfa133 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..9270ab23ca8099e4d6305f38034b6f75894fcdd7 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{ title }} {{text}} + + +
diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3e9e350a6040cf669a4a4334a9d433941a9b44cb --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js @@ -0,0 +1,36 @@ +/* + * 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} from 'deccjsunit/index' + +export default { + data: { + title: "", + text: "" + }, + onInit() { + this.title = this.$t('strings.world'); + this.text = "MainAbility 1111" + }, + onShow() { + console.info('onShow finish') + const core = Core.getInstance() + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + require('../../../test/List.test.js') + core.execute(); + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.js b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.js new file mode 100644 index 0000000000000000000000000000000000000000..4d7b924de9ab853460183177c60502732dcf51c6 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.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. + */ + +export default { + + onCreate() { + console.info("ApplicationMainAbility2 onCreate"); + }, + + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "page": "Second Page", + "next": "Next Page", + "back": "Back" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "page": "第二页", + "next": "下一页", + "back": "返回" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..8b5cce53e8f61458e5a3005866217e0df1dfa133 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..e4857299b06a30f43c2c0a9e9f2404c4b3fa78cb --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{ title }} + + +
diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f3fd01a5e589fb3dabd56508f3b66b5b0dbfd90e --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js @@ -0,0 +1,69 @@ +/* + * 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' +import featureAbility from '@ohos.ability.featureAbility' + +let event = '' +let commonEventPublishData = '' + +function PublishCallBackOne() { + console.info("====>Publish CallBack SUB_AA_OpenHarmony_Want_0200_CommonEvent====>"); +} +function PublishCallBackTwo() { + console.info("====>Publish CallBack SUB_AA_OpenHarmony_Want_0300_CommonEvent====>"); +} + + + +export default { + data: { + title: '' + }, + onInit() { + this.title = this.$t('strings.world ApplicationMainAbility2'); + }, + onShow() { + console.info('======Start MainAbility2 onShow======'); + featureAbility.getWant( + (err, data) => { + if (data.uri == '{true,true,false}'){ + console.info("SUB_AA_OpenHarmony_Want_0200_StartAbility" + JSON + .stringify(data) + JSON.stringify(err)); + event = data.uri + commonEventPublishData = { + data: event, + } + commonEvent.publish('SUB_AA_OpenHarmony_Want_0200_CommonEvent', + commonEventPublishData, PublishCallBackOne); + } + if (data.type == 'MIMETYPE'){ + console.info("SUB_AA_OpenHarmony_Want_0300_StartAbility" + JSON + .stringify(data) + JSON.stringify(err)); + event = data.type + commonEventPublishData = { + data: event, + } + commonEvent.publish('SUB_AA_OpenHarmony_Want_0300_CommonEvent', + commonEventPublishData, PublishCallBackTwo); + + } + } + ) + }, + onReady() { + console.info('ApplicationInfo MainAbility2 onReady'); + }, +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..425cf6173c67c2ba92f95274b86903e6a494222b --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png differ diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js new file mode 100644 index 0000000000000000000000000000000000000000..5a932e1eceac1dec829f5d1a7ff56f20ab006b2a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonevent' +import featureAbility from '@ohos.ability.featureability' +import formBindingData from '@ohos.application.formBindingData' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +var getCallingBundleUri = { + events: ['SUB_AA_OpenHarmony_Want_0200_CommonEvent'] +} + +var getCallingBundleType = { + events: ['SUB_AA_OpenHarmony_Want_0300_CommonEvent'] +} + +describe('ApplicationInfoTest', function () { + var TAG = '';- + + /* + * @tc.number SUB_AA_OpenHarmony_FormBase_1000 + * @tc.name Validate formbindingdata creation data + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_FormBase_1000', 0, async function (done) { + console.info('------------start SUB_AA_OpenHarmony_FormBase_1000-------------'); + TAG = 'SUB_AA_OpenHarmony_FormBase_1000'; + var dataObj = { + temperature:"11c", + "time":"11:00", + "test":11, + "test3":true + } + var result = formBindingData.createFormBindingData(dataObj) + console.log(TAG + " result is : " + JSON.stringify(result)) + expect(JSON.stringify(result)). + assertEqual(JSON.stringify({"data":"{\"temperature\":\"11c\",\"time\":\"11:00\",\"test\":11,\"test3\":true}"})); + done(); + console.info('------------end SUB_AA_OpenHarmony_FormBase_1000-------------'); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Want_0200 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Want_0200', 0, async function (done) { + console.info('------------start SUB_AA_OpenHarmony_Want_0200-------------'); + TAG = 'SUB_AA_OpenHarmony_Want_0200'; + var Subscriber = ''; + + function SubscribeCallBackUri(err, data) { + console.info(TAG + ' Subscribe CallBack data:' + JSON.stringify(data) + JSON.stringify(err)); + expect(data.data == '{true,true,false}').assertTrue(); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + done(); + } + + function UnSubscribeCallback() { + console.debug(TAG + "====>UnSubscribe CallBack====>"); + done(); + } + + commonEvent.createSubscriber(getCallingBundleUri).then(async (data) => { + console.info(TAG + '====>Create Subscriber===='); + Subscriber = data; + console.info(TAG + '====>Create Subscriber====' + JSON.stringify(data) ); + await commonEvent.subscribe(Subscriber, SubscribeCallBackUri); + }); + + featureAbility.startAbility({ + want: { + abilityName: 'com.example.applicationinfo.MainAbility2', + bundleName: 'com.example.applicationinfo', + uri: '{true,true,false}' + } + }, (err, data) => { + console.info(TAG + ':startAbility success , err:' + JSON.stringify(err) + ',data:' + JSON.stringify(data)); + }); + console.info('------------end SUB_AA_OpenHarmony_Want_0200-------------'); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Want_0300 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Want_0300', 0, async function (done) { + console.info('------------start SUB_AA_OpenHarmony_Want_0300-------------'); + TAG = 'SUB_AA_OpenHarmony_Want_0300'; + var Subscriber = ''; + + function SubscribeCallBackType(err, data) { + console.info(TAG + ' Subscribe CallBack data:' + JSON.stringify(data) + JSON.stringify(err)); + expect(data.data == 'MIMETYPE').assertTrue(); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + done(); + } + + function UnSubscribeCallback() { + console.debug(TAG + "====>UnSubscribe CallBack====>"); + done(); + } + + commonEvent.createSubscriber(getCallingBundleType).then(async (data) => { + console.info(TAG + '====>Create Subscriber====>'); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBackType); + }); + + featureAbility.startAbility({ + want: { + abilityName: 'com.example.applicationinfo.MainAbility2', + bundleName: 'com.example.applicationinfo', + type: 'MIMETYPE', + } + }, (err, data) => { + console.info(TAG + ':startAbility success , err:' + JSON.stringify(err) + ',data:' + JSON.stringify(data)); + }); + console.info('------------end SUB_AA_OpenHarmony_Want_0300-------------'); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..df59d7bd31485fd5019a068084937a9c2b27fe63 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faapplicationinfo/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('./ApplicationInfoJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/faapplicationinfo/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..bf893c5fa3f7c335b731c76c5ad1b45620889f25 Binary files /dev/null and b/aafwk/aafwk_standard/fa/faapplicationinfo/signature/openharmony_sx.p7b differ diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/BUILD.gn b/aafwk/aafwk_standard/fa/faconfigurationconstant/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..22ca6cc8362c8100283067158b49b544bdf5407b --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/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("ActsConfigurationconstantTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsConfigurationconstantTest" +} +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/aafwk/aafwk_standard/fa/faconfigurationconstant/Test.json b/aafwk/aafwk_standard/fa/faconfigurationconstant/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..66e69f5275c22b55f1cac8489ada5bb4f1f06f14 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.configuration", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsConfigurationconstantTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/config.json b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..714158b1e65a27be599400ca02361366cc463116 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/config.json @@ -0,0 +1,63 @@ +{ + "app": { + "bundleName": "com.example.configuration", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.configuration", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.configuration.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.UPDATE_CONFIGURATION", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..c158442201abb1888ae8fb1d57f150c5ec26c36b --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/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/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/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/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/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/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..a6053c61f9615fcd50fefb51f878568f3e39e59b --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..6069a046a35c4409ab85e4595a079a1670a9c7fe --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..43f7611f8ff1cf870dfbf48dd5bd9a8790e15b8f --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,52 @@ +/* + * 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') +let once = true +export default { + data: { + title: '' + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + if (once) { + once = false + 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) + this.timeout = 10000 + + require('../../../test/List.test') + core.execute() + } + }, + onReady() { + console.info('onReady'); + }, +} + diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..76e501f214f84c96a44d08973dbbdeab8515e1de --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png differ diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js new file mode 100644 index 0000000000000000000000000000000000000000..73bc3c98be38307ad1a0a7cff8212dfb32624c4d --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ConfigurationConstant from '@ohos.application.ConfigurationConstant' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ConfigurationTest', function () { + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100 + * @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------"); + expect(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT).assertEqual(1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200 + * @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_DARK" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------"); + expect(ConfigurationConstant.ColorMode.COLOR_MODE_DARK).assertEqual(0); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300 + * @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------"); + expect(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET).assertEqual(-1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100 + * @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_VERTICAL" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------"); + expect(ConfigurationConstant.Direction.DIRECTION_VERTICAL).assertEqual(0); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200 + * @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_HORIZONTAL" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------"); + expect(ConfigurationConstant.Direction.DIRECTION_HORIZONTAL).assertEqual(1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300 + * @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_NOT_SET" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------"); + expect(ConfigurationConstant.Direction.DIRECTION_NOT_SET).assertEqual(-1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI).assertEqual(120); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI).assertEqual(160); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI).assertEqual(240); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI).assertEqual(320); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI).assertEqual(480); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI).assertEqual(640); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET).assertEqual(0); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------"); + }); +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..ae35e4b64a1cf30dd0eb9763a3220d333a367706 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faconfigurationconstant/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('./JsConfiguration.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/faconfigurationconstant/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..bf893c5fa3f7c335b731c76c5ad1b45620889f25 Binary files /dev/null and b/aafwk/aafwk_standard/fa/faconfigurationconstant/signature/openharmony_sx.p7b differ diff --git a/aafwk/aafwk_standard/fa/facoverapi/BUILD.gn b/aafwk/aafwk_standard/fa/facoverapi/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..dd80f3fe60a09a42c25a3094cd27c0b04971f7d8 --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/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("ActsCoverapiTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsCoverapiTest" +} +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/aafwk/aafwk_standard/fa/facoverapi/Test.json b/aafwk/aafwk_standard/fa/facoverapi/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..de47a6d2f9eb8014b416b3ff0a75985dad5ae815 --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.coverapi", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsCoverapiTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/config.json b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..a9d8a0ccae7e878522b76b293bcaba206856edb5 --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/config.json @@ -0,0 +1,53 @@ +{ + "app": { + "bundleName": "com.example.coverapi", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.coverapi", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.coverapi.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..c158442201abb1888ae8fb1d57f150c5ec26c36b --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/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/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/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/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/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/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..a6053c61f9615fcd50fefb51f878568f3e39e59b --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..6069a046a35c4409ab85e4595a079a1670a9c7fe --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..43f7611f8ff1cf870dfbf48dd5bd9a8790e15b8f --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,52 @@ +/* + * 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') +let once = true +export default { + data: { + title: '' + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + if (once) { + once = false + 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) + this.timeout = 10000 + + require('../../../test/List.test') + core.execute() + } + }, + onReady() { + console.info('onReady'); + }, +} + diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..76e501f214f84c96a44d08973dbbdeab8515e1de --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png differ diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js new file mode 100644 index 0000000000000000000000000000000000000000..700fb02008477cc4c2bbbf3637dc51d2b72354f5 --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import appManager from '@ohos.application.appManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; + +describe('CoverApiTest', function () { + + /* + * @tc.number SUB_AA_OpenHarmony_CoverApi_0500 + * @tc.name whether the system is under stability test + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_CoverApi_0500', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------"); + appManager.isRunningInStabilityTest() + .then((data) => { + console.info('SUB_AA_OpenHarmony_CoverApi_0500 successful. data: ' + JSON.stringify(data)); + expect(data == false).assertTrue(); + done(); + }).catch((error) => { + console.error('SUB_AA_OpenHarmony_CoverApi_0500 failed. error: ' + JSON.stringify(error)); + expect().assertFalse(); + done(); + }) + }); +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..a3112d89f77c1691be0ac0e38061b257e40f730f --- /dev/null +++ b/aafwk/aafwk_standard/fa/facoverapi/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('./JsCoverApi.test') \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/facoverapi/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/facoverapi/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..bf893c5fa3f7c335b731c76c5ad1b45620889f25 Binary files /dev/null and b/aafwk/aafwk_standard/fa/facoverapi/signature/openharmony_sx.p7b differ diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/BUILD.gn b/aafwk/aafwk_standard/fa/faequeryabilitybywant/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5d013055f879e866ce8439baad9b84e45841513d --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/BUILD.gn @@ -0,0 +1,33 @@ +# 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("ActsEqueryabilitybywantTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsEqueryabilitybywantTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js" + hap_profile = "entry/src/main/config.json" + js2abc = true +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/Test.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..dff3dbbbc1e57f1c72f65e802bc89e46952af49f --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.abilitydisable", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsEqueryabilitybywantTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/config.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..74a7653450c315ec8a79a49704f859e6a27a7e2e --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/config.json @@ -0,0 +1,144 @@ +{ + "app": { + "bundleName": "com.example.abilitydisable", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.abilitydisable", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility3", + "name": ".MainAbility3", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability3", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility4", + "name": ".MainAbility4", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability4", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "srcPath": "ServiceAbility", + "name": ".ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "js", + "description": "$string:description_serviceability", + "type": "service" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility3", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility4", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..10ea3bb1104ae82203d0ecc7173d4d35a3a16f16 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.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. + */ +export default { + onCreate() { + console.info("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + }, + onForgeGround(){ + console.info("Application onForgeGround"); + } +}; diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "page": "Second Page", + "next": "Next Page", + "back": "Back" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "page": "第二页", + "next": "下一页", + "back": "返回" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..9c27d02f668220192c6ceaa0c7e6a83f189bd7f0 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.hello') }} {{ title }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e380f7fb9bc4e5abe4ac083b5b25bdf23c9abaae --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js @@ -0,0 +1,52 @@ +/* + * 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 router from '@system.router' +import {Core} from 'deccjsunit/index' + +export default { + data: { + title: "" + }, + onInit() { + this.title = 'yingyong1'; + }, + onclick: function () { + router.replace({ + uri: "pages/second/second" + }) + }, + onShow() { + console.info('onShow start') + const core = Core.getInstance() + console.info('onShow start1') + + core.init() + console.info('onShow start2') + + const configService = core.getDefaultService('config') + console.info('onShow start3') + + configService.setConfig(this) + console.info('onShow start4') + + require('../../../test/List.test') + console.info('onShow start5') + + core.execute() + } +} + + + diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml new file mode 100644 index 0000000000000000000000000000000000000000..232a295e9245fb2e09d7be62626850bfd281062a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.page') }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js new file mode 100644 index 0000000000000000000000000000000000000000..55c229adf9b349ff9a374f8d91be5b5b31d7c6aa --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js @@ -0,0 +1,26 @@ +/* + * 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 router from '@system.router' + +export default { + data: { + title: 'World' + }, + onclick: function () { + router.replace({ + uri: "pages/index/index" + }) + } +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js new file mode 100644 index 0000000000000000000000000000000000000000..c432f74d63028e07036dc374b7799339497f4dc7 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js @@ -0,0 +1,37 @@ +/* + * 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("Application onCreate"); + setTimeout(()=>{ + this.content.terminateSelf().then((data)=>{ + console.log("Application terminateSelf data:" + JSON.stringify(data) ) + }).catch((error)=>{ + console.log("Application terminateSelf data:" + JSON.stringify(error) ) + }) + },4000) + }, + onDestroy() { + console.info("Application onDestroy"); + } + + + + + + + + +}; diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "page": "Second Page", + "next": "Next Page", + "back": "Back" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "page": "第二页", + "next": "下一页", + "back": "返回" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..83ae6b784af095aa173906f7aa7468eb2bf2e5e3 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.hello') }} {{ title }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3f2aef42e1765f6b6525a547205650df5113fa7b --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/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 router from '@system.router' +import {Core} from 'deccjsunit/index' + +export default { + data: { + title: "" + }, + onInit() { + this.title = 'yingyong2'; + }, + onclick: function () { + router.replace({ + uri: "pages/second/second" + }) + }, + onShow() { + console.info('onShow start') + const core = Core.getInstance() + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + require('../../../test/List.test') + core.execute() + } +} + + + diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml new file mode 100644 index 0000000000000000000000000000000000000000..4503365d59184ec671bb489b6c2b64134daf0849 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.page') }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js new file mode 100644 index 0000000000000000000000000000000000000000..55c229adf9b349ff9a374f8d91be5b5b31d7c6aa --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js @@ -0,0 +1,26 @@ +/* + * 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 router from '@system.router' + +export default { + data: { + title: 'World' + }, + onclick: function () { + router.replace({ + uri: "pages/index/index" + }) + } +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js new file mode 100644 index 0000000000000000000000000000000000000000..0da0f36d6651025a1fd93b9c868e48fae3ae93f6 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js @@ -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 abilityFeatureAbility from '@ohos.ability.featureAbility'; + +export default { + onCreate() { + console.info("Application onCreate MainAbility3"); + setTimeout(()=>{ + abilityFeatureAbility.terminateSelf().then((data)=>{ + console.log("Application terminateSelf data:" + JSON.stringify(data) ) + }).catch((error)=>{ + console.log("Application terminateSelf data:" + JSON.stringify(error) ) + }) + },4000) + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "page": "Second Page", + "next": "Next Page", + "back": "Back" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "page": "第二页", + "next": "下一页", + "back": "返回" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..9c27d02f668220192c6ceaa0c7e6a83f189bd7f0 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.hello') }} {{ title }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..539f7a8795ff62dafcf3b64bd0c3a5a363d1921d --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/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 router from '@system.router' +import {Core} from 'deccjsunit/index' + +export default { + data: { + title: "" + }, + onInit() { + this.title = 'yingyong3'; + }, + onclick: function () { + router.replace({ + uri: "pages/second/second" + }) + }, + onShow() { + console.info('onShow start') + const core = Core.getInstance() + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + require('../../../test/List.test') + core.execute() + } +} + + + diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml new file mode 100644 index 0000000000000000000000000000000000000000..232a295e9245fb2e09d7be62626850bfd281062a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.page') }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js new file mode 100644 index 0000000000000000000000000000000000000000..55c229adf9b349ff9a374f8d91be5b5b31d7c6aa --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js @@ -0,0 +1,26 @@ +/* + * 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 router from '@system.router' + +export default { + data: { + title: 'World' + }, + onclick: function () { + router.replace({ + uri: "pages/index/index" + }) + } +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.js new file mode 100644 index 0000000000000000000000000000000000000000..911b14c23c120306ed0406cf704036085bf16653 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.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. + */ +export default { + onCreate() { + console.info("Application onCreate"); + setTimeout(()=>{ + this.content.terminateSelf().then((data)=>{ + console.log("Application terminateSelf data:" + JSON.stringify(data) ) + }).catch((error)=>{ + console.log("Application terminateSelf data:" + JSON.stringify(error) ) + }) + },4000) + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "page": "Second Page", + "next": "Next Page", + "back": "Back" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "page": "第二页", + "next": "下一页", + "back": "返回" + }, + "Files": { + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..9c27d02f668220192c6ceaa0c7e6a83f189bd7f0 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.hello') }} {{ title }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..32a7c170b8cc255bb4dffb7bf64c16b9159538a0 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/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 router from '@system.router' +import {Core} from 'deccjsunit/index' + +export default { + data: { + title: "" + }, + onInit() { + this.title = 'yingyong4'; + }, + onclick: function () { + router.replace({ + uri: "pages/second/second" + }) + }, + onShow() { + console.info('onShow start') + const core = Core.getInstance() + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + require('../../../test/List.test') + core.execute() + } +} + + + diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css new file mode 100644 index 0000000000000000000000000000000000000000..737096ca1070d46824d8173dd029de7e4144f3a9 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml new file mode 100644 index 0000000000000000000000000000000000000000..232a295e9245fb2e09d7be62626850bfd281062a --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml @@ -0,0 +1,20 @@ + +
+ + {{ $t('strings.page') }} + + +
diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js new file mode 100644 index 0000000000000000000000000000000000000000..55c229adf9b349ff9a374f8d91be5b5b31d7c6aa --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js @@ -0,0 +1,26 @@ +/* + * 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 router from '@system.router' + +export default { + data: { + title: 'World' + }, + onclick: function () { + router.replace({ + uri: "pages/index/index" + }) + } +} diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js new file mode 100644 index 0000000000000000000000000000000000000000..ccdcaa6a0802492216d3332f39f8e089e7334630 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js @@ -0,0 +1,40 @@ +/* + * 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 { + onStart(want) { + console.info('ServiceAbility onStart'); + }, + onStop() { + console.info('ServiceAbility onStop'); + }, + onConnect(want) { + console.info('ServiceAbility onConnect'); + return {}; + }, + onReconnect(want) { + console.info('ServiceAbility onReconnect'); + }, + onDisconnect() { + console.info('ServiceAbility onDisconnect'); + }, + onCommand(want, restart, startId) { + console.info('ServiceAbility onCommand'); + }, + + onForeground(){ + console.info('ServiceAbility onForeground'); + }, + +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1d2808e5cc8d694e37f10acd62ce27334db762e6 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,40 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_mainability3", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility3", + "value": "entry_MainAbility3" + }, + { + "name": "description_mainability4", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility4", + "value": "entry_MainAbility4" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png differ diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js new file mode 100644 index 0000000000000000000000000000000000000000..e3e3d3de74360d488b9d20ddac1c7d3045880aed --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundleManager from '@ohos.bundle'; +import account from "@ohos.account.osAccount" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +let userId; +describe('AbilityDisable', function () { + + /* + * @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0100 + * @tc.name Call queryAbilityByWant to get moduleName + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0100", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_EqueryAbilityByWant_0100-------------------"); + let accountManager = account.getAccountManager(); + let bundleFlags=bundleManager.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION; + await accountManager.getOsAccountLocalIdFromProcess().then((data)=>{ + console.log("success get userId:" + JSON.stringify(data)); + userId = data; + }).catch((err)=>{ + console.log("+++++++++++++" + JSON.stringify(err)); + }) + let want={ + bundleName:"com.example.abilitydisable", + abilityName:"com.example.abilitydisable.MainAbility" + }; + bundleManager.queryAbilityByWant(want,bundleFlags,userId,(err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 queryAbilityByWant errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for(var i=0;i{ + console.log("success get userId:" + JSON.stringify(data)); + userId = data; + }).catch((err)=>{ + console.log("+++++++++++++" + JSON.stringify(err)); + }) + let want={ + bundleName:"com.example.abilitydisable", + abilityName:"com.example.abilitydisable.MainAbility" + }; + bundleManager.queryAbilityByWant(want,bundleFlags,userId,(err, data) => { + console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0200 queryAbilityByWant errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for(var i=0;i{ + console.log("success get userId:" + JSON.stringify(data)); + userId = data; + }).catch((err)=>{ + console.log("+++++++++++++" + JSON.stringify(err)); + }) + bundleManager.getApplicationInfo(bundleName, bundleFlags,userId,(err, data) => { + console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0300 getapplicationInfo errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data['name']).assertEqual("com.example.abilitydisable"); + }) + done(); + }); +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..1c1f7fc58b57f36e31ce878f7f0dc264f6b5bf76 --- /dev/null +++ b/aafwk/aafwk_standard/fa/faequeryabilitybywant/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('./JsAbilityDisable.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/faequeryabilitybywant/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..bf893c5fa3f7c335b731c76c5ad1b45620889f25 Binary files /dev/null and b/aafwk/aafwk_standard/fa/faequeryabilitybywant/signature/openharmony_sx.p7b differ diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json index c138e812d3d5e47df1f2248a903fb326b64041bb..932f888500827535fc3666b62336a3a67c811b05 100644 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json @@ -53,7 +53,7 @@ "launchType": "singleton", "process": "processTestAbility", "permissions": ["ohos.permission.ACCELEROMETER"], - "deviceCapability": ["screen_support","audio_support"], + "deviceCapability": ["ability_base","ability_runtime"], "uri": "uriTest", "visible": true } diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets index df4051cf73db31ef0a26bfb9e9c5b572e2e86860..a97c45e3506f9794d248c4f2b123a341f7917237 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets +++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets @@ -388,6 +388,28 @@ export default function applicationBundleJsunit() { }); }); + /** + * @tc.number: getApplicationInfo_1800 + * @tc.name: getApplicationInfo : Obtains based on a given bundle name and flag. + * @tc.desc: Check whether fingerprint gets + */ + it('getApplicationInfo_1800', 0, async function (done) { + await Bundle.getApplicationInfo(BUNDLE_NAME, + Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT).then((data) => { + expect(data.fingerprint).assertFail("8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"); + }).catch((error) => { + expect(error).assertEqual(1); + }); + Bundle.getApplicationInfo(BUNDLE_NAME, + Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT, (error, data) => { + expect(data.fingerprint).assertFail("8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"); + if(error){ + expect(err).assertEqual(1); + } + done(); + }); + }); + function expectData(msg, data) { expect(typeof (data)).assertEqual('object'); expect(typeof (data.name)).assertEqual('string'); @@ -408,6 +430,7 @@ export default function applicationBundleJsunit() { expect(typeof (data.enabled)).assertEqual('boolean'); expect(typeof (data.uid)).assertEqual('number'); expect(typeof (data.entityType)).assertEqual('string'); + expect(typeof (data.fingerprint)).assertEqual('string'); expect(typeof (data.removable)).assertEqual('boolean'); expect(Array.isArray(data.permissions)).assertEqual(true); expect(Array.isArray(data.moduleSourceDirs)).assertEqual(true); diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js index 7589b8ac26eafbcad1dc207e09b08bef29f06ce5..d46e6ccdd22562dc83930f6834fbb0ed0ce1d344 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js @@ -90,7 +90,7 @@ describe('ActsBundleManagerTest', function () { } expect(datainfo.entryModuleName).assertEqual("entry"); expect(datainfo.isSilentInstallation.length).assertEqual(0); - expect(datainfo.minCompatibleVersionCode).assertEqual(0); + expect(datainfo.minCompatibleVersionCode).assertEqual(1); expect(datainfo.entryInstallationFree).assertEqual(false); for (let j = 0; j < datainfo.appInfo.moduleInfos.length; j++) { expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry"); @@ -153,7 +153,7 @@ describe('ActsBundleManagerTest', function () { } expect(datainfo.entryModuleName).assertEqual("entry"); expect(datainfo.isSilentInstallation.length).assertEqual(0); - expect(datainfo.minCompatibleVersionCode).assertEqual(0); + expect(datainfo.minCompatibleVersionCode).assertEqual(1); expect(datainfo.entryInstallationFree).assertEqual(false); for (let j = 0; j < datainfo.appInfo.moduleInfos.length; j++) { expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry"); @@ -232,7 +232,7 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.updateTime).assertLarger(0); expect(datainfo.uid).assertLarger(0); expect(datainfo.entryModuleName).assertEqual("entry"); - expect(datainfo.minCompatibleVersionCode).assertEqual(0); + expect(datainfo.minCompatibleVersionCode).assertEqual(1); expect(datainfo.entryInstallationFree).assertEqual(false); expect(datainfo.reqPermissions.length).assertEqual(0); expect(datainfo.reqPermissionStates.length).assertEqual(0); @@ -276,7 +276,7 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.updateTime).assertLarger(0); expect(datainfo.uid).assertLarger(0); expect(datainfo.entryModuleName).assertEqual("entry"); - expect(datainfo.minCompatibleVersionCode).assertEqual(0); + expect(datainfo.minCompatibleVersionCode).assertEqual(1); expect(datainfo.entryInstallationFree).assertEqual(false); expect(datainfo.reqPermissions.length).assertEqual(0); expect(datainfo.reqPermissionStates.length).assertEqual(0); @@ -502,7 +502,7 @@ describe('ActsBundleManagerTest', function () { } expect(dataInfo.entryModuleName).assertEqual("entry"); expect(dataInfo.isSilentInstallation.length).assertEqual(0); - expect(dataInfo.minCompatibleVersionCode).assertEqual(0); + expect(dataInfo.minCompatibleVersionCode).assertEqual(1); expect(dataInfo.entryInstallationFree).assertEqual(false); for (let j = 0; j < dataInfo.appInfo.moduleInfos.length; j++) { expect(dataInfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry"); @@ -551,7 +551,7 @@ describe('ActsBundleManagerTest', function () { } expect(dataInfo.entryModuleName).assertEqual("entry"); expect(dataInfo.isSilentInstallation.length).assertEqual(0); - expect(dataInfo.minCompatibleVersionCode).assertEqual(0); + expect(dataInfo.minCompatibleVersionCode).assertEqual(1); expect(dataInfo.entryInstallationFree).assertEqual(false); for (let j = 0; j < dataInfo.appInfo.moduleInfos.length; j++) { expect(dataInfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry");