提交 59d3e242 编写于 作者: K kirl.liu

Add dataability xts code

Signed-off-by: Nkirl.liu <kirl.liu@huawei.com>
上级 aa365bff
# 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("ActsDataAbilityJsTest") {
hap_name = "ActsDataAbilityJsTest"
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
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"
}
{
"description": "Configuration for hjsunit Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "100000",
"package": "com.example.actsdataabilityjstest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsDataAbilityJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsdataabilityjstest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsdataabilityjstest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsdataabilityjstest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "singleton",
"visible": true
}
],
"reqPermissions": [
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO",
"reason":"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name":"ohos.permission.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.MANAGE_MISSIONS",
"reason":"need use ohos.permission.MANAGE_MISSIONS"
},
{
"name":"ohos.permission.GET_RUNNING_INFO",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
},
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
},
{
"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* 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('ActsProcessManageJsTest onCreate');
},
onDestroy() {
console.info('ActsProcessManageJsTest onDestroy');
},
onShow() {
console.info('ActsProcessManageJsTest onShow');
},
onHide() {
console.info('ActsProcessManageJsTest onHide');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.btn {
width: 200px;
height: 80px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<button class="btn" type="capsule" value="start" onclick="start"></button>
</div>
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Core, ExpectExtend } from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "",
testTime: 0
},
onInit() {
console.info('Acts_DataAbilityJSTest onInit');
this.title = this.$t('strings.world');
},
onShow() {
console.info('Acts_DataAbilityJSTest onShow');
console.info('Acts_DataAbilityJSTest testTime' + this.testTime);
if (this.testTime == 0) {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 30000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
this.testTime++;
},
onReady() {
console.info('Acts_DataAbilityJSTest onReady');
},
onActive() {
console.info('Acts_DataAbilityJSTest onActive');
},
onInactive() {
console.info('Acts_DataAbilityJSTest onInactive');
},
onHide() {
console.info('Acts_DataAbilityJSTest onHide');
},
onDestroy() {
console.info('Acts_DataAbilityJSTest onDestroy');
},
onBackPress() {
console.info('Acts_DataAbilityJSTest onBackPress');
},
onNewRequest() {
console.info('Acts_DataAbilityJSTest onNewRequest');
},
onStartContinuation() {
console.info('Acts_DataAbilityJSTest onStartContinuation');
},
onSaveData(value) {
console.info('Acts_DataAbilityJSTest onSaveData:' + JSON.stringify(value));
},
onRestoreData(value) {
console.info('Acts_DataAbilityJSTest onRestoreData:' + JSON.stringify(value));
},
onCompleteContinuation(code) {
console.info('Acts_DataAbilityJSTest onCompleteContinuation:' + JSON.stringify(code));
},
onConfigurationUpdated(configuration) {
console.info('Acts_DataAbilityJSTest onConfigurationUpdated:' + JSON.stringify(configuration));
}
}
{
"string": [
{
"name": "app_name",
"value": "actsparticleabilitytest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* 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('./ActsDataAbilityJsTest.test.js')
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册