diff --git a/startup/startup_standard/BUILD.gn b/startup/startup_standard/BUILD.gn index 928cdcbb59b9875c9b94f3f53f1ebfba04b4f751..fbcac9e27c5c1bd643f13abf6b1c07a14eeac652 100644 --- a/startup/startup_standard/BUILD.gn +++ b/startup/startup_standard/BUILD.gn @@ -18,6 +18,7 @@ group("startup_standard") { if (is_standard_system) { deps = [ "deviceinfo:startup_deviceinfo_js_test", + "syscap_ndk:startup_syscapability_js_test", "systemparamter:startup_sysparam_js_test", ] } diff --git a/startup/startup_standard/syscap_ndk/BUILD.gn b/startup/startup_standard/syscap_ndk/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5f9272174908e98641e3bcccfd36d52a1b5cd256 --- /dev/null +++ b/startup/startup_standard/syscap_ndk/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("startup_syscapability_js_test") { + hap_profile = "./src/main/config.json" + deps = [ + ":startup_js_assets", + ":startup_js_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsStartupSysCapabilityTest" +} +ohos_js_assets("startup_js_assets") { + source_dir = "./src/main/js/default" +} +ohos_resources("startup_js_resources") { + sources = [ "./src/main/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/startup/startup_standard/syscap_ndk/Test.json b/startup/startup_standard/syscap_ndk/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..55bc1127ea8f15922383fa2eaeb82e0a22625e91 --- /dev/null +++ b/startup/startup_standard/syscap_ndk/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for startup syscap js api Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "ohos.acts.startup.syscap.function", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsStartupSysCapabilityTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/startup/startup_standard/syscap_ndk/signature/openharmony_sx.p7b b/startup/startup_standard/syscap_ndk/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/startup/startup_standard/syscap_ndk/signature/openharmony_sx.p7b differ diff --git a/startup/startup_standard/syscap_ndk/src/main/config.json b/startup/startup_standard/syscap_ndk/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..988832820442e3f3857e7d5d1664587e56e7a587 --- /dev/null +++ b/startup/startup_standard/syscap_ndk/src/main/config.json @@ -0,0 +1,60 @@ +{ + "app": { + "bundleName": "ohos.acts.startup.syscap.function", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5 + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.acts.startup.syscap.function", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "ohos.acts.startup.syscap.function.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/startup/startup_standard/syscap_ndk/src/main/js/default/app.js b/startup/startup_standard/syscap_ndk/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..e423f4bce4698ec1d7dc86c3eea3990a5e7b1085 --- /dev/null +++ b/startup/startup_standard/syscap_ndk/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/startup/startup_standard/syscap_ndk/src/main/js/default/i18n/en-US.json b/startup/startup_standard/syscap_ndk/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..25b4997e50df3af032339fe395b293b95a44c275 --- /dev/null +++ b/startup/startup_standard/syscap_ndk/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "OpenHarmony" + } +} \ No newline at end of file diff --git a/startup/startup_standard/syscap_ndk/src/main/js/default/i18n/zh-CN.json b/startup/startup_standard/syscap_ndk/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..b9543e1912f72ea9075609981bf64496330cbb41 --- /dev/null +++ b/startup/startup_standard/syscap_ndk/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "鸿蒙OS" + } +} \ No newline at end of file diff --git a/startup/startup_standard/syscap_ndk/src/main/js/default/pages/index/index.css b/startup/startup_standard/syscap_ndk/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/startup/startup_standard/syscap_ndk/src/main/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/startup/startup_standard/syscap_ndk/src/main/js/default/pages/index/index.hml b/startup/startup_standard/syscap_ndk/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/startup/startup_standard/syscap_ndk/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +